|
Welcome, Guest.
|
||||||
| AutoLISP AutoLISP or Visual LISP, learn both here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: 2003-12
Posts: 7
![]() |
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 |
|
|
|
|
|
#3 |
|
I could stop if I wanted to
Join Date: 2003-05
Posts: 335
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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 |
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|
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 |