+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Forum Newbie
    Discipline
    Construction
    Using
    AutoCAD 2016
    Join Date
    Oct 2017
    Posts
    3

    Question Switching to another drawing in a running VBA session

    Registered forum members do not see this ad.

    My VBA application requires 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 draiwng 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
    Forum Newbie
    Discipline
    Construction
    Using
    AutoCAD 2016
    Join Date
    Oct 2017
    Posts
    3

    Default

    I've narrowed the problem down:

    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.L istIndex).Activate
    ThisDrawing.Application.Documents.Item(ComboBox1.L istIndex).Regen acAllViewports

    all works fine, BUT

    The GETPOINT line is only successful in the drawing that was active BEFORE I started my application and Fails in the other activated drawing:

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



    Anyone any idea what's need to be set before I can use it in the newly activated drawing?

    Thanks

  3. #3
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Oct 2013
    Posts
    78

    Default

    Quote Originally Posted by ArjenB View Post
    I've narrowed the problem down:

    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.L istIndex).Activate
    ThisDrawing.Application.Documents.Item(ComboBox1.L istIndex).Regen acAllViewports

    all works fine, BUT

    The GETPOINT line is only successful in the drawing that was active BEFORE I started my application and Fails in the other activated drawing:

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



    Anyone any idea what's need to be set before I can use it in the newly activated drawing?

    Thanks

    have you already tested this proposal?

  4. #4
    Forum Newbie
    Discipline
    Construction
    Using
    AutoCAD 2016
    Join Date
    Oct 2017
    Posts
    3

    Default

    Registered forum members do not see this ad.

    Hi RICVBA,

    Yep, just tested it, it failed again and replied on the other forum with more details (Watch state).

    Thanks

Similar Threads

  1. Can Not Save File - Drawing Open in Another Session
    By resullins in forum AutoCAD Bugs, Error Messages & Quirks
    Replies: 27
    Last Post: 18th Jun 2016, 09:49 am
  2. Replies: 12
    Last Post: 12th Jun 2014, 09:20 am
  3. Bit Of A CAD Drawing Problem - running slow
    By GA-CAD in forum AutoCAD General
    Replies: 1
    Last Post: 10th Dec 2009, 11:48 am
  4. Drawing running away
    By P_c in forum AutoCAD Drawing Management & Output
    Replies: 34
    Last Post: 12th Jul 2007, 04:51 pm
  5. Switching units in a drawing.
    By redcoat in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 10th Mar 2006, 06:31 pm

Tags for this Thread

Bookmarks

Posting Permissions

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