WPerciful Posted January 7, 2014 Posted January 7, 2014 This code: (command "new" "S:\\CADCore\\Titleblocks\\Facilities A Model.dwt") Gives me this error: Unknown command "DWT". Press F1 for help. Please help Quote
satishrajdev Posted January 7, 2014 Posted January 7, 2014 Have a look on this once.... http://lee-mac.com/open.html Quote
WPerciful Posted January 7, 2014 Author Posted January 7, 2014 Wouldn't that open the template file for editing. I want to make a new drawing using the template. Quote
Tharwat Posted January 7, 2014 Posted January 7, 2014 Add your Template into the folder of templates then change the name of the template from the following code . (vla-add (vla-get-documents (vlax-get-acad-object)) "acadiso.dwt") Quote
Snownut Posted January 7, 2014 Posted January 7, 2014 How about using the command "/T" line switch when you start ACAD. Quote
WPerciful Posted January 13, 2014 Author Posted January 13, 2014 Which post you picked ? I am working on a new drawing DCL. But before I took that on I decided that I would work on loading templates first. To do that I have made scripts that would load them, then a menu that would run the scripts. We keep our templates on the network drive. new "S:\CADCore\Titleblocks\Facilities FS Model.dwt" Then I have a routine that can fill out the attributed values of the titleblock. But I had issues running the one routine right after the script. So I thought I’d switch over to just using autolisp/visp to open the new drawing and fill out the titleblock. Your method for loading the templates seems to be more in-line with what I’m attempting to do. But I’d need to copy the templates to the user’s pc. I tried using your code to load them from the shared drive, since it’s pathed in the options. But it didn’t seem to work for me. It would start a new drawing but there would be nothing in it. Quote
Barranello Posted March 24, 2022 Posted March 24, 2022 On 1/7/2014 at 4:27 PM, Tharwat said: Add your Template into the folder of templates then change the name of the template from the following code . (vla-add (vla-get-documents (vlax-get-acad-object)) "acadiso.dwt") How do I evoke this with a command, rather than run on load. I get an error when I add a defun Example (defun C:QNewNT () (vla-add (vla-get-documents (vlax-get-acad-object)) "xxx.dwt") Quote
Tharwat Posted March 24, 2022 Posted March 24, 2022 You need to keep the name of the template the same or change it to the ones that are available in your AutoCAD and you can explore that once you invoke the new or qnew command. You did miss one close bracket at the end of your example. 1 Quote
tombu Posted March 24, 2022 Posted March 24, 2022 Example macro from the first location that sets you new drawing current once it's added: ^C^C^P(vla-activate (vla-Add (vla-get-Documents (vlax-get-acad-object)) (strcat "S:" (chr 92) "template" (chr 92) "Titleblocks" (chr 92) "Facilities A Model.dwt"))) Entering the same thing at the command line without ^C^C^P part does the same thing. (vla-activate (vla-Add (vla-get-Documents (vlax-get-acad-object)) (strcat "S:" (chr 92) "template" (chr 92) "Titleblocks" (chr 92) "Facilities A Model.dwt"))) Like Tharwat said it's simpler if you add your Template into the default Template folder: ^C^C^P(vla-activate (vla-Add (vla-get-Documents (vlax-get-acad-object)) "Facilities A Model.dwt"))) 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.