Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Specify file name with DIESEL

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
sthompson1021
2133 Views, 7 Replies

Specify file name with DIESEL

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. 

7 REPLIES 7
Message 2 of 8
scot-65
in reply to: sthompson1021

In a command macro found inside the lower-left pane of the CUI?
You can do this in LISP...
(strcat "X:/XXX/PDFS/" (getvar 'DWGNAME))

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 3 of 8
sthompson1021
in reply to: scot-65

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).

Message 4 of 8
joselggalan
in reply to: sthompson1021

 

In menu:

 

$(eval,"C:/XXX/PDF/" $(getvar,dwgname))

 

test in lisp:

(menucmd (strcat "M=" "$(eval," "\"C:/XXX/PDF/\""  "$(getvar,dwgname))"))

 

Message 5 of 8
sthompson1021
in reply to: joselggalan

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.

Message 6 of 8
steven-g
in reply to: sthompson1021

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)

Message 7 of 8
sthompson1021
in reply to: steven-g

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.

Message 8 of 8
Anonymous
in reply to: sthompson1021

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.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report