New drawing from a template

New drawing from a template

charles_neelyFG4LK
Contributor Contributor
510 Views
3 Replies
Message 1 of 4

New drawing from a template

charles_neelyFG4LK
Contributor
Contributor

I'm trying to get a new drawing from a template other than the default. Below is what I have. When I run it, hangs up w/ the path on the command line. If I press enter it creates a new dwg but with the default template. 

 

;SheetCreation
(defun c:nft ()
(setq template(getstring "C:/WSB_ACAD Support/_C3D/2024/01_Templates/Civil-C3D-Styles-2024.dwt"))
(vla-activate (vla-Add (vla-get-Documents (vlax-get-acad-object)) template))
(princ)
)
0 Likes
Accepted solutions (1)
511 Views
3 Replies
Replies (3)
Message 2 of 4

Sea-Haven
Mentor
Mentor

Why not set your template as the default when you type New. Just do OPTIONS FILES TEMPLATE, set the Template name including path, set the Template path also.

 

The other way is use "OPEN" it works with dwt also. 

(command "OPEN" "MYDWT")
0 Likes
Message 3 of 4

ec-cad
Collaborator
Collaborator
Accepted solution

Change: 

(setq template(getstring "C:/WSB_ACAD Support/_C3D/2024/01_Templates/Civil-C3D-Styles-2024.dwt"))

To be:

(setq template "C:/WSB_ACAD Support/_C3D/2024/01_Templates/Civil-C3D-Styles-2024.dwt")

ECCAD

0 Likes
Message 4 of 4

charles_neelyFG4LK
Contributor
Contributor

Thank you!! I appreciate the help!

0 Likes