Consulting

Results 1 to 4 of 4

Thread: Switching to another drawing in an AutoCAD session

  1. #1

    Switching to another drawing in an AutoCAD session

    My VBA application requires 3D (2D + Height) coordinate info from one drawing to be used in another one in the same VBA running session.


    I need to ALIGN one drawing based upon 3 3D points from another drawing automatically.


    At the moment I'm running my application to collate the info from drawing 1, store it, close my application to open the other drawing and run my application again to retrieve the info to ALIGN it.


    Any idea how I can switch to another loaded drawing in the same VBA running session?


    Thanks!

  2. #2
    I've narrowed the problem down.

    I can switch drawings now whilst my application is running.

    I've created a combobox to switch drawings whilst my application is running and even ACTIVATE and REGEN the selected drawing:

    ThisDrawing.Application.Documents.Item(ComboBox1.ListIndex).Activate
    ThisDrawing.Application.Documents.Item(ComboBox1.ListIndex).Regen acAllViewports

    The GETPOINT line is only successful in the drawing that was active before I started my application:

    PrikPnt = ThisDrawing.Utility.GetPoint(Basepnt, PrikPointTexT)

    The error I get in all other drawings I select and activate:

    error.jpg

    Anyone any idea what's need to be set before I can use it?

    Thanks

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    VBA is Application specific. What Application is your VBA Project running in?

    Application = Excel, Word, Outlook, Etc.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  4. #4
    Yep, sorry, was inspecific: running in AutoCAD 2016.

    Thanks for pointing out.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •