Print Page | Close Window

Open a dxf file in lisp

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=13563
Printed Date: 20.Apr.2026 at 00:56


Topic: Open a dxf file in lisp
Posted By: paulodavid2004
Subject: Open a dxf file in lisp
Date Posted: 24.Feb.2021 at 03:52
Hi, I found a partial answer  to a question that I have. I need to know how to open a dxf file in a lisp. The following code opens a dwg file but not a dxf type of file. Could someone kindly help me to modify this code to open a dxf type of file. Thanks in advance!

(setq acApp (vlax-get-acad-object))
(setq acDocs (vla-get-documents acApp))
(vla-open acDocs "d:/drawings/mydrawing.dwg")


-------------
Paulo



Replies:
Posted By: Vladimir Michl
Date Posted: 24.Feb.2021 at 06:15
Try:

(setq newDoc (vlax-invoke acadDocs 'open "myfile.dxf"))


-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner



Print Page | Close Window