Is there a way to change the QNEW Default Template name with a system variable?
I have 20+ plus users doing different types of drawings that sometimes need a different template setup. I know the name is sored in the registry, however I was wondering if it can be renamed from inside AutoCAD, without changing it in the Options> Files tab. My ultimate goal is to have a tool bar or ribbon button to toggle between the different templates.
If anybody has any other ideas, they are certainly welcome.
Moderator: Please move this post to another group if needed.
Thanks
Solved! Go to Solution.
Solved by RockyBrown4134. Go to Solution.
not exactly a Sysvar, but if you turn FILEDIA off, the New command can bypass the dialog, and you can feed a dwt name to it.
So one button that has:
(setvar "filedia" 0)
new
acadiso.dwt
(setvar "filedia" 1)
and copy/change the dwt name as needed. As long as they are all in the Template path in options, there shouldn't be any problems finding them
You could setup different profiles for each template required. Then use lisp and CUI to create a button to toggle. Change-Profile-from-Command-Line-Lisp
I will give this a try and let you know how it works.
If you do go with Mary's suggestion (which sounds great to me), one thing to note is that you will want to be sure your users regularly make exports of their various profiles for backup/recovery purposes. (Sometimes profiles get screwed up through no fault of the user.) This can also be automated and placed on a button or menu right along with the profile switchers.
@dmfrazier wrote:If you do go with Mary's suggestion (which sounds great to me), one thing to note is that you will want to be sure your users regularly make exports of their various profiles for backup/recovery purposes. (Sometimes profiles get screwed up through no fault of the user.) This can also be automated and placed on a button or menu right along with the profile switchers.
I thought about this, however, the number of Users X Number of Template Profiles would result in too many workspaces to try to manage and troubleshoot, in the event something has gone wrong. I haven't said no to this yet. Just "Wait a minute and let me think on it".
@jggerth1 wrote:
So one button that has:
(setvar "filedia" 0)
new
acadiso.dwt
(setvar "filedia" 1)
and copy/change the dwt name as needed. As long as they are all in the Template path in options, there shouldn't be any problems finding them
I coded a command in the CUI just like you had it above. It "Hangs up" and CUI command comes open. When I close that, AutoCAD has a promt to verify the template. Please see the attached on How I have it coded in the CUI. Could it be I am using AutoCAD 2012?
Fair enough.
Though I disagree that having the ability to choose among different profiles (however you decide to do it) would require changing the workspace (unless the profiles specify different CUI files). Assuming all of a given user's profiles specify the same "main" CUI (which is the "usual" case), that means all their workspaces (assuming they need more than one) would/should be stored in one place.
Since workspaces are stored in CUI files, it's a good idea to back them up as well.
Maybe a thought...
What if you were to use templates stored in a tool palette? Sub-palettes for different disciplines. Mechanical, Architectural, Civil, etc.
e.g. Civil might have two or more different templates (Bridge, Road, Grading, Plan & Profile, etc.)
Users then would narrow the selection of a template down to what they were working on for that session.
Just sayin' the groundwork for tool palettes already exists within the program and can be stored in one location but accessed by many users. I would think this system would be easy to maintain when a template needs to be revised. There would be no need for individual users to "save" a template to their Desktop. Which I have seen, in my own experience, when you try to dictate template usage through other means. (some people are lazy in many regards.)
Users usually use the wrong template for two reasons: either they have "the one they use all the time" on their desktop or they copy an old drawing to create a new one.
@steve216586 wrote:Maybe a thought...
What if you were to use templates stored in a tool palette? Sub-palettes for different disciplines. Mechanical, Architectural, Civil, etc.
Good thought. Considering the idea.
I have some that I can't get them to use tool pallatte's now. Would require some training.
Expeimenting with a some lisp. I read a post last night and got the Idea. I can't take take credit for the inital thought, credit goes to Mark in his reply to Ben Zismann in the following post: .New Template LISP .
Here is where I am at.
For Each Template, I created a command in the lisp file as such:
(DEFUN c:detail_ANSI_A (/)
(setvar "cmdecho" 0)
(setq olderr *error*
*error* CHGTERR)
(setq tn "ANSI A Detail_2014.dwt")
(newTemplate tn)
);END DEFUN
The sub-routine "newTemplate" came from the post I read. It is as follows:
(defun newTemplate ( tempname )
(vla-add
(vla-get-documents
(vlax-get-acad-object))
Tempname)
(princ)
)
Both of these commands are in a Lisp file called NEWTEMP.lsp and I load it at startup.
I have a bug where after it creates the new drawing from the indicated template, AutoCAD reverts back to the prwvious drawing in which the command was envoked. CTL+TAB gets me to the new drawing. I have to work on that.
If I get the bug worked out, my goal is to try to put it in the CUI as a Tool Button, or in a ribbon panel.
Ok...Scrap that I idea. I read this post over the weekend, changing default templateand it talked about the Variable "QnewTemplate". This resets the Default Template File Name for QNEW in Options.
So I tried this method.
1) Created a new CUI menu Called "Template"
2) Created a menu called "Template Mode"
3) Created a command to set each template type, Command name is the template name, with the command defined as:
^C^C(setenv "QnewTemplate" "H:/ACAD2012/Template/ANSI D_2014.dwt").
4) I partially loaded the template.cuix
Now, I can go to the menu and set the template mode I want. Then, all that i have to do is click "Qnew" and that template comes up. Then When I want to change the template mode to another type, I click the type in the menu and I am ready go again.
I have not fully test this theory. But so far, no glitches. I don't know if this is the correct way to accomplish the task, but it works. I will post after I have tested more.
This sounds like a good workflow. Lot of different ways to accomplish the same thing!
Thank you! "(setenv "QnewTemplate" "H:/ACAD2012/Template/ANSI D_2014.dwt")" is exactly what I was looking for.