CAD FORUM - TIPS & TRICKS | UTILITIES | DISCUSSION | BLOCKS | SUPPORT | HELP & ASSISTANCE
Over 1.124.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips, Civil tips, Fusion tips.
The new Beam calculator, Spirograph generator and Regression curves in the Converters section.
New AutoCAD 2027 commands and sys.variables
CAD tip # 7381:
Question
A
If you want to open a different DWG drawing from your LISP application, the solution is apparently simple:
(command "_.OPEN" "d:\\drawings\\mydrawing.dwg")in higher AutoCAD versions use:
(command "_.FILEOPEN" "d:\\drawings\\mydrawing.dwg")But this method works only in the single document environment (SDI=1). In the default multiple document environment (MDI; SDI=0), this function creates a new document and activates it. But it doesn't pass the filename parameter properly as the command execution returns immediately back to the original document (drawing).
To solve this problem, you can use VisualLISP and the ActiveX interface in AutoCAD. You can invoke the open method for another document with these commands (program control will return to the original document):
(setq acApp (vlax-get-acad-object)) (setq acDocs (vla-get-documents acApp)) (vla-open acDocs "d:/drawings/mydrawing.dwg")
ACAD
1.6.2010
28265×
this tip shared by ARKANCE experts applies to: AutoCAD ·
![CAD Forum - ARKANCE Community - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]](../common/arkance_186.png)

What is the ARKANCE Community?