Inserting Templates

rseyda

Usenet Archive
Joined
Aug 13, 2003
Messages
9
Reaction score
0
I am going to ask a potentially ignorant question.

I want to put into custom pulldown menus the ability to start a new drawing using a template. The problem is that I can't insert a .dwt file. I also can't use the New command without a dialog box. How do you start a new drawing using a template without a dialog box?

Thanks,
 
directly from AutoCAD help...
"If the system variable, FILEDIA, is set to 0 instead of 1, a prompt on the command line is displayed. If you set FILEDIA to 0, this prompt is displayed regardless of the Startup setting. " HTH mark

rseyda said:
I am going to ask a potentially ignorant question.

I want to put into custom pulldown menus the ability to start a new
drawing using a template. The problem is that I can't insert a .dwt file. I also can't use the New command without a dialog box. How do you start a new drawing using a template without a dialog box?
 
_new

rseyda said:
I am going to ask a potentially ignorant question.

I want to put into custom pulldown menus the ability to start a new
drawing using a template. The problem is that I can't insert a .dwt file. I also can't use the New command without a dialog box. How do you start a new drawing using a template without a dialog box?
 
Oops, Mark's right, it's filedia=0 that causes new to run at the command line, not the underscore.

rseyda said:
I am going to ask a potentially ignorant question.

I want to put into custom pulldown menus the ability to start a new
drawing using a template. The problem is that I can't insert a .dwt file. I also can't use the New command without a dialog box. How do you start a new drawing using a template without a dialog box?
 
So, code would look like:
(defun loaddwt
(setvar "FILEDIA" 0)
(command "_new")
(setvar "FILEDIA" 1)
)

Remember to turn the Files Dialog back on, or next time you try to open another .dwg, you will have to type it in at the command prompt, including the Formal Path\...\filename.dwg Cheers
 
2nd thought here. Last 'loaddwt' function will stop at _new. Why, this is a 'new' drawing session, and the Lisp will not carry across. This method would kinda work in a script, but not here. Better way ? Perhaps the File= on Open ?, specify a .dwg (that is nothing but a 'saved' .dwt - by the same name.
Bob
 
Ok, so in my pull down menu I have:

[<-36x48](setvar "users4" "S-3648detail");newtemp;

This sets the users4 variable to the template name, then I call to run the lisp routine:

(defun c:newtemp ( / fdia tname)
(setq fdia (getvar "filedia"))
(setvar "filedia" 0)
(setq tname (getvar "users4"))
(command "new" tname)
(setvar "filedia" fdia)
)

But when I do I get this message:

Command: newtemp
new
Command: S-3648detail Unknown command "S-3648DETAIL". Press F1 for help.

Command: 0

I checked and filedia was set to 0, but the new command didn't work. Any ideas?

Thanks,
 
(command "new" tname)
is the problem.
use:
(command "new")
new is not expecting a name, so, save the template as a .dwg, and do:
(command "_open" tname)
instead.
 

Latest threads

Back
Top