Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-06-21, 11:58 AM   #1
rajat126
Member
 
Join Date: 2003-12
Posts: 7
rajat126 is starting their journey
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 Glenndp : 2004-06-21 at 03:14 PM. Reason: placed routine into code tag
rajat126 is offline   Reply With Quote
Old 2004-06-21, 06:13 PM   #2
MarkTheSwampThomas
Member
 
Join Date: 2004-02
Location: Tampa, Florida
Posts: 32
MarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightly
Default

You can only run Vlisp from one activedocument. You can however modify the others, just don't try to make them active.
__________________
C3D/LDT2006
I'd rather be using NetBSD
MarkTheSwampThomas is offline   Reply With Quote
Old 2004-06-22, 03:10 PM   #3
whdjr
I could stop if I wanted to
 
Join Date: 2003-05
Posts: 335
whdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of light
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.
__________________
Good Blockin'

Will DeLoach
AutoCad / ADT 2006
whdjr is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Revit PDF Writer 4.2 Installation Problem dnilsson Revit Architecture - General 9 2004-06-16 04:14 PM
Drawing Index Problem! nblevins Revit - Worksharing/Worksets 2 2004-06-15 07:56 PM
PEDIT System Variable for Multiple Option ntaylor AutoCAD "Original" Wish List (Archived) 0 2004-06-10 12:59 AM
Strange Autocad Viewport Problem razorx Revit Architecture - General 3 2004-06-07 08:19 PM
Multiple In-place Families jasonb3 Revit Architecture - Tips & Tricks 0 2004-06-03 08:47 PM


All times are GMT +1. The time now is 03:43 PM.