Results 1 to 3 of 3

Thread: Problem in working in multiple document environment

  1. #1
    Member
    Join Date
    2003-12
    Posts
    7
    Login to Give a bone
    0

    Angry Problem in working in multiple document environment

    Hi,
    I am an ActiveX learner and I have a little problem.

    ** Assuming: More than one document is opened.
    If "drawing1" is the ActiveDocument, then I want to Activate "drawing2" as ActiveDocument and send some commands to newly activated (drawing2) document.But my program does not work correctly.It will be very helpful if you rectify this program with proper explanation.
    Thanks,
    Rajat
    Kolkata
    India

    Here is my program:

    Code:
    ; ** More than one document must exists.
    (defun xx (/ app documents dc docs doc mspace)
      (vl-load-com)
      (setq app (vlax-get-acad-object))
      (setq documents (vla-get-Documents app))
      (vlax-for dd documents (setq docs (cons dd docs)))
      (setq doc (vla-get-activedocument app)) ; Get current ActiveDocument.
      
      (if(equal doc (nth 0 docs))(setq dc (nth 1 docs))(setq dc (nth 0 docs))) ; Find another document which is not ActiveDocument.
      (vla-put-activedocument app dc) ; Specify document "dc" as ActiveDocument ;
      
      (setq doc (vla-get-activedocument app)) ; Get current ActiveDocument.
      (setq mspace (vla-get-ModelSpace doc))  ; Get Current ActiveDocument's ModelSpace.
      
      (vla-addcircle mspace (vlax-3d-point '(3.0 3.0 0.0)) 10) ; Add circle in the Active ModelSpace.
      (vla-ZoomExtents app) ; Zoom in the current viewport.
      (princ)
    )
    Last edited by Glenn Pope; 2004-06-21 at 01:14 PM. Reason: placed routine into code tag

  2. #2
    Member
    Join Date
    2004-02
    Location
    Tampa, Florida
    Posts
    32
    Login to Give a bone
    0

    Default Re: Problem in working in multiple document environment

    You can only run Vlisp from one activedocument. You can however modify the others, just don't try to make them active.

  3. #3
    I could stop if I wanted to
    Join Date
    2003-05
    Posts
    335
    Login to Give a bone
    0

    Default Re: Problem in working in multiple document environment

    Rajat,

    You can access the other documents for manipulation through the document object. ActiveX doesn't allow you to make another drawing active, but it does allow you to manipulate the document. This should for you.

Similar Threads

  1. MP118-3: Working in a Dual CAD Program Environment
    By Autodesk University in forum MEP Design and Engineering
    Replies: 0
    Last Post: 2014-12-01, 03:30 AM
  2. ME104-1: Working in a Dual Workflow Environment: AutoCAD MEP and Revit MEP
    By Autodesk University in forum Mechanical Engineering and Design
    Replies: 0
    Last Post: 2013-05-05, 02:25 AM
  3. DM31-1: Engineering Document Collaboration: Working Outside the Box
    By Autodesk University in forum Data Management
    Replies: 0
    Last Post: 2012-11-24, 07:38 PM
  4. working with multi document in .dll class
    By t_khoshzaman in forum Dot Net API
    Replies: 8
    Last Post: 2009-01-18, 09:59 PM
  5. Standard Working Environment
    By ljones.27809 in forum AutoCAD CUI Menus
    Replies: 5
    Last Post: 2005-11-07, 01:26 PM

Posting Permissions

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