PDA

View Full Version : QnewTemplate



KGC
2008-02-12, 01:39 PM
This string does not work. And neither does my help.

I searched around and found a thread that led me to a PDF that lists all the environmental variables, but its only good till 2005.


Im also looking for a string to edit the Authoring Tool Palette.



Thanks,
Kenton

tedg
2008-02-12, 01:59 PM
This string does not work. And neither does my help.

I searched around and found a thread that led me to a PDF that lists all the environmental variables, but its only good till 2005.


Im also looking for a string to edit the Authoring Tool Palette.




Thanks,
Kenton
What's your question/issue about "qnew template"?

KGC
2008-02-12, 02:02 PM
It comes back nill

No Function Definition

Im trying to figure out what the correct string is

tedg
2008-02-12, 02:31 PM
It comes back nill

No Function Definition

Im trying to figure out what the correct string is
Maybe you could post an example (and an explanation) of what you're trying to do with your lisp routine?

Are you trying to define a path for your qnew template?

Open up a drawing using the qnew command?
I think I know what you mean, you can't seem to use the "qnew" command in a lisp routine. (I tried "._qnew", "-qnew", "-qnew" ".qnew", "_qnew",etc no luck).
If this is the case, you may need to use a whole path calling that template, just a thought.
Something like:
(setvar "filedia" 0)
(command "new" "template" ....blah blah.)
(setvar "filedia" 1)

KGC
2008-02-12, 02:33 PM
(vla-put-QnewTemplate *files* "L:\\PROGRAMS\\AutoCAD\\Support Folder\\Standard Files\\Base Template.dwt")

tedg
2008-02-12, 02:40 PM
(vla-put-QnewTemplate *files* "L:\\PROGRAMS\\AutoCAD\\Support Folder\\Standard Files\\Base Template.dwt")

Sorry, over my head (I don't know much about VLISP)
Maybe one of the gurus out there can assist you.

KGC
2008-02-12, 02:41 PM
I dont either, im just trying to finish up this lisp so that i can use it on our server.

Thanks though

KGC
2008-02-12, 03:08 PM
i figured out the correct string for this


(vla-put-QnewTemplateFile *files* "L:\\)

tedg
2008-02-12, 03:10 PM
i figured out the correct string for this


(vla-put-QnewTemplateFile *files* "L:\\)
Nice.
This will help someone with a similar problem someday.
:beer:

.T.
2008-02-12, 05:59 PM
i figured out the correct string for this


(vla-put-QnewTemplateFile *files* "L:\\)

Based on not having a closing quote in this code, It's possible you may have a stray quote somewhere else in your code. As written above, it should return an error, or perhaps ("_> , or it may just not set the path (I'm not sure, and haven't tested it).

The "no function definition" error was probably due to not having the vl functions loaded yet. Add
(vl-load-com) as the first line of your code.

HTH

KGC
2008-02-12, 06:58 PM
i just posted a portion of the code not all of it.

.T.
2008-02-12, 07:25 PM
i just posted a portion of the code not all of it.

Yes, and that portion isn't correctly formatted. It should have a " before the last parens because vla-put-QnewTemplateFile expects a string as that argument. It also expects a file name, not a directory:

That is why I stated that you may have an extraneous " somewhere.



(setq *files* (vla-get-files (vla-get-preferences (vlax-get-acad-object))))
(vla-put-QnewTemplateFile *files* "L:\\PROGRAMS\\AutoCAD\\Support Folder\\Standard Files\\Base Template.dwt")

should work, if the template exists, and is in that directory. I would probably wrap it in a (if (findfile.... to make sure the file exists in case L: isn't mapped on some other computer that you run it from.

The second part about vl-load-com may or may not apply, as you needed vla-put-QnewTemplateFile instead of vla-put-QnewTemplate.

In Developer's Guide, under ActiveX and VBA Reference, expand Objects and look at the
PreferencesFiles object. It has a list of all of the properties.

Just trying to help...

KGC
2008-02-12, 07:31 PM
Correct, here is the code in its entirety


(vl-load-com)
(setq acadloc
(vl-registry-read
(strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key))
"ACADLOCATION")
)
(setq *files* (vla-get-files
(vla-get-preferences (vlax-get-acad-object))
))

(setq sfsp
(strcat
"L:\\PROGRAMS\\AUTOCAD\\SUPPORT FOLDER\\SUPPORT;"
"L:\\PROGRAMS\\AUTOCAD\\SUPPORT FOLDER\\SUPPORT MAIN;"
"L:\\PROGRAMS\\AUTOCAD\\SUPPORT FOLDER\\FONTS;"
"L:\\PROGRAMS\\AUTOCAD\\SUPPORT FOLDER\\HELP;"
"L:\\PROGRAMS\\AUTOCAD\\SUPPORT FOLDER\\EXPRESS;"
"L:\\PROGRAMS\\AUTOCAD\\SUPPORT FOLDER\\SUPPORT MAIN\\COLOR;"
"L:\\PROGRAMS\\AUTOCAD\\CADD STANDARDS\\KSQ TOOL PALETTES;"
(getvar "ROAMABLEROOTPREFIX") "SUPPORT;"
(getvar "LOCALROOTPREFIX") "SUPPORT;"
)
)

(vla-put-SupportPath *files* sfsp)

(vla-put-TemplateDwgPath *files* "L:\\PROGRAMS\\AutoCAD\\Support Folder\\Standard Files")
(vla-put-PrinterConfigPath *files* "L:\\PROGRAMS\\AutoCAD\\Support Folder\\Plotters")
(vla-put-PrinterStyleSheetPath *files* "L:\\PROGRAMS\\AutoCAD\\Support Folder\\Plot Styles")
(vla-put-ToolPalettePath *files* "L:\\PROGRAMS\\AutoCAD\\Cadd Standards\\KSQ Tool Palettes")
(vla-put-QnewTemplateFile *files* "L:\\PROGRAMS\\AutoCAD\\Support Folder\\Standard Files\\Base Template.dwt")

(vlax-release-object *files*)

.T.
2008-02-12, 07:43 PM
Correct, here is the code in its entirety


Oh, I see. :lol: :Oops:

There was a closing paren, so I thought that was the code you were using.

Sorry, I misunderstood what you were saying. :beer:

KGC
2008-02-12, 07:45 PM
its cool, i prob should have shown the whole string rather then just part of it.

Any thoughts though on why my VLisp Help doesnt work?

.T.
2008-02-12, 07:52 PM
its cool, i prob should have shown the whole string rather then just part of it.

Any thoughts though on why my VLisp Help doesnt work?

Have a look in <drive>:Program Files\<Autocad Flavor>\Help for acad_dev.chm. Is it there?

KGC
2008-02-12, 08:32 PM
yeah its there

.T.
2008-02-12, 08:52 PM
yeah its there

You're working through vlide, right?

It's not working via the help menu, or is it not working via Apropos, or the little ? button when you have a function highlighted?

Just to verify, you can use Apropos on a partial function name to do a quick search for the function you are looking for, then click the ? button when you highlight the function.

For the ? button on the toolbars, unless the full function name is highlighted, you'll probably get a "This program cannot display the webpage" error.

Am I on the right track here?

KGC
2008-02-12, 08:57 PM
yes you are.

Inside of vlide, when i go to the help menu and search for anythings i get that error. apropro works i think.

But when i click the '?' i still get nothing

.T.
2008-02-12, 09:45 PM
yes you are.

Inside of vlide, when i go to the help menu and search for anythings i get that error. apropro works i think.

But when i click the '?' i still get nothing

Well carp! Mine doesn't work either. :shock: In my case, the search tab is blank. I use the Apropos method, and hadn't noticed before.

I searched and could only find a solution for prior versions that involved re-registering hhctrl.ocx, but I tried that and it didn't work.

I suspect that the help file may be old and perhaps incompatible with the current hhctrl.ocx. :?:

Sorry, I can't be of much more help than that. ~wading in over my head~

Maybe someone else has a solution.

KGC
2008-02-12, 09:47 PM
HUH

Well that is odd.

.T.
2008-02-12, 10:22 PM
HUH

Well that is odd.

Good old Google (http://www.texupport.net/cadinfo/autocad/visual-lisp-ides-help-file-is-unsearchable-in-2008.html)...

And I'm on SP2.

KGC
2008-02-12, 10:25 PM
Would you look at that. I have a thread going on Autodesk, but ill have to search around and see if anything new has come up on this.