Script not accepting a carriage return

Script not accepting a carriage return

mark.martinezECRPT
Advocate Advocate
823 Views
2 Replies
Message 1 of 3

Script not accepting a carriage return

mark.martinezECRPT
Advocate
Advocate

I am trying to use a script to plot but when the script gets to the layout name, I cannot get the script to accept the default with a carriage return (after the first _Yes command).  Instead, it tries to use the next line for the name of the layout name.  I have hit enter once, twice, once with "" but nothing seems to work.

 

(setq draw_address(getvar "dwgprefix"))
(setq draw_name(getvar "dwgname"))
(setq draw_len (strlen draw_name))
(setq draw_name (strcat (substr draw_name 1 (- draw_len 4))".pdf"))
(setq draw_name (strcat draw_address draw_name ))
;;
(if(="Model" (getvar "ctab"))
(command "_-plot"
"_Yes"

 


"DWG To PDF_bsize.pc3"
"ANSI full bleed B (17.00 x 11.00 Inches)"
"_Inches"
"_Landscape"
"_No"
"_Extents"
"1:1"
"_C"
"_Yes"
"my_standard_plt.ctb"
"_Yes"
"_No"
"_Yes"
"_No"
draw_name
"_No"
"_Yes")
(command "_-plot"
"_Yes"

 


"DWG To PDF_bsize.pc3"
"ANSI full bleed B (17.00 x 11.00 Inches))"
"_Inches"
"_Landscape"
"_No"
"_Extents"
"1:1"
"_C"
"_Yes"
"my_standard_plt.ctb"
"_Yes"
"_No"
"_Yes"
"_No"
draw_name
"_No"
"_Yes"))
))

0 Likes
Accepted solutions (1)
824 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant

An AutoLisp routine is not a Script -- the word has a specific meaning in AutoCAD, and this isn't it.

 

Within an AutoLisp (command) function, Enter is represented by "", not an actual carriage return as in a Script.  Try this approach:

....

(command "_-plot"
"_Yes"

""

""
"DWG To PDF_bsize.pc3"

....

 

But I'm skeptical....  If this is a real Script in a .scr file, I don't think you can do the (if) thing with 'then' and 'else' arguments.  Some AutoLisp functions can go into command macros or scripts, but I'm not sure about that one.  I think you may need to make it an all-out AutoLisp routine defining a command name, and then use that command rather than a Script file.

 

[And in a Script, none of those text entries except maybe the ones with spaces within them would need the quotation marks, but maybe they don't hurt.]

Kent Cooper, AIA
0 Likes
Message 3 of 3

mark.martinezECRPT
Advocate
Advocate
Accepted solution

Yes, it's an .scr file.  I did find my mistake.  I had an extra parathesis in the second plot command.

0 Likes