AutoCAD/autolisp
Expert: Bill DeShawn - 8/28/2009
Questioni have 8 a4 sheets in a drawing
i want to take pdf with autolisp
i had written as
(command "plot" "y" "model""Adobe PDF" "a4"
"" "Portrait"
"n" "Window"
;LB
(list (+ (car lb)0) (+ (cadr lb)-3))
RT
"fit"
"c"
"Y"
"monochrome.ctb"
"n"
;"Asdisplayed:"
"n"
"n"
"y"
"y")
but every time it is asking me the drawing
how do i do it please give me the solution
AnswerVivek: Whenever you present a question to us here at AllExperts, you need to tell us what versio of AutoCAD you are running, so that we can address your question more appropriately. There is a semicolon in your code, and I am not understanding why it's there. Semicolons are used to make the code behind it ineffective.
There are symbols in this code that without seeing the code that defines the symbol, it is difficult or impossible to decipher what the symbols represent.
I recommend the following:
In AutoCAD, use the -PLOT command (with the minus sign) to see exactly what steps to take in your code. Write the code out to emulate the command exactly. If there are any errors, try to address them one at a time.
Vivek:
You said, "it is adking me the drawing". I think you mean it is asking you of a PDF file name. That would be reasonable. You can do that with if you are using layouts, but I see that you are using the Model Tab and plotting different windows in model space. This is not normally accomplished like this. You need to do this in paper space. That way you can use AutoLISP to automatically make up a PDF file name based on the drawing name and the layout name.
However, one way to do this in model space is if you have eight windows to define, you can give each windows a name like "Window1", "Window2", etc. use that in the creation of your filename. Like this:
(strcat (getvar "dwgname")"_Window1.pdf"), or (strcat (getvar "dwgname")"_Window2.pdf")
and do that for eight windows.
If you do this in a layout (paper space), it would look like this:
(strcat (getvar "dwgname") "_" (getvar "ctab") ".pdf")
Let me know how it goes:
Bill DeShawn
http://my.sterling.net/~bdeshawn