- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings dear AutoCAD gurus,
My goal is to make a LISP script to open a file with dwt extension as if I would open it through "new" button. That means that it should open, and not with .dwt extension but with dwg extension. I want that for creating some buttons for different templates.
I tried to find answer on the forum, but I am sorry I could not - there are many examples that should work but they don't in my case.
These are some short scripts that I tried:
1. Using the Open command: (command "OPEN" "C:\ACAD_ISO_ANNO_B6_A3.dwt")
And the result is that Autocad says that dwt is unknown command like if it recognizes the period symbol inside quotation marks for system symbol.
Here is a set of command line strings I get:
=== START ===
Command: (command "OPEN" "C:\ACAD_ISO_ANNO_B6_A3.dwt")
OPEN
Command: C:ACAD_ISO_ANNO_B6_A3.dwt Unknown command "DWT". Press F1 for help.
Command: nil
=== END ===
2. Using vla function: (vla-open (vla-get-documents (vlax-get-acad-object)) "C:/ACAD_ISO_ANNO_B6_A3.dwt")
The result is that it opens the file but as an original template with dwt extension. Whereas I want it to be something like Drawing1.dwg.
My question or request is if it is possible to solve on both and how, what am I doing wrong?
Interested in Lisp
Solved! Go to Solution.