As the subject says, I'm trying to specify a path and file name to save to in a macro. I've got the path figured out but can't get the drawing name to come up as the file name. Here's what I've been trying to use and it don't work. X:/XXX/PDFS/$(GETVAR, DWGNAME). It will save to the right drive and folder but the file name will be DWGNAME). If I take the space out after getvar, it totally ignores the diesel expression and tries to save the pdf as N.pdf (N is the next command in the macro). I'm a total no mind when it comes to LISP and Diesel so any help would be much appreciated.
Solved! Go to Solution.
Solved by sthompson1021. Go to Solution.
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
Thanks for the reply, unforunatly the macro will be assigned to a button and used on LT stations so no LISP. Thats why I'm trying to do it with Diesel. The whole macro is ^C^C-plot;Y;;DWG To PDF.pc3;ANSI B (17.00 x 11.00 inches);I;L;N;E;F;C;Y;monochrome.ctb;Y;A;L:/OSP/PDFS/$(GETVAR, DWGNAME);N;Y;
As it is right now, it will plot the pdf and put it in the PDFS folder but the file name will be DWGNAME).
In menu:
$(eval,"C:/XXX/PDF/" $(getvar,dwgname))
test in lisp:
(menucmd (strcat "M=" "$(eval," "\"C:/XXX/PDF/\"" "$(getvar,dwgname))"))
Thanks for the reply, I did a little more reading on using diesel in macros and found that I needed to use $M=$(getvar,dwgname). The macro works just fine now as long as I'm not in the same drive as I'm trying to plot to. If I'm in a dwg on my C: drive or my H: drive, it will plot to the folder in the L; drive with no problem. However if I'm in the L: drive, the macro breaks at the file name part. I tried modifying it with your (eval) suggestion but couldn't get it to work. The new macro is ^C^C-plot;Y;;DWG To PDF.pc3;ANSI B (17.00 x 11.00 inches);I;L;N;E;F;C;Y;monochrome.ctb;Y;A;L:/OSP/PDFS/$M=$(getvar,DWGNAME);N;Y; I'm open to any other ideas. This new twist has really got me stumped.
I tried the macro exactly as you supplied it, only changing the drive letter to "C" as I am not on a network, and it worked perfectly, so long as the file path exists. When you say it breaks, what actually happens, could you post the command line history to see if that shows any clues. By the way there is a hidden variable "macrotrace" if you set that too equal 1, the command line gives you a better response for debbuging (though it's not easy to follow sometimes)
I figured out what the problem was. If there is a space in the drawing name, it will stop the macro. It had nothing to do with the drive I was trying to plot from.
I am facing the same problem with the splitting in the string.
It evaluates properly, but when the file name is "inserted" after the evaluation it is splitting where the "\" are.
^C^C-plot;;;;;$M=$(eval,$(substr,$(getvar,"dwgprefix")$(getvar,"dwgname"),1,$(-,$(strlen,$(getvar,"dwgprefix")$(getvar,"dwgname")),4))".pdf");;;
Can't find what you're looking for? Ask the community or share your knowledge.