mjab8 Posted January 19 Posted January 19 I wanted to append the sheet number to my quick plot to pdf. Much appreciated if someone can help to append the sheet number to the filename with _S before the sheet number. Also having difficulty with the getkword for sheet number with 1 as Default. Example of wanted outcome is A123_S2.pdf for Sheet 2 of drawing A123. Thanks in advance. Part of my lisp as below: (vl-load-com) (setq sht (cond ((getkword "\nEnter Sheet number <1>:"))("1"))) (cond ((= sht "1")(setq sheet "1")) ) (setq fname (vl-filename-base (getvar 'dwgname))) (strcat fname "_S" sht) (setq p1 (getpoint "\nPick first corner to plot: ")) (setq p2 (getcorner p1 "\nPick opposite corner: ")) (command "-plot" "Y" "Model" "Gaaiho PDF" "A3-H" "M" "L" "N" "W" p1 p2 "F" "C" "Y" ctb "Y" "A" "N" "N" "Y" fname) Quote
Steven P Posted January 19 Posted January 19 getkword and you need to set the keywords with initget in the line above (best the line immediately before). For (setq sht (cond.... line I think you have too many brackets, see below (initget 1 "1") (setq sht (cond ((getkword "\nEnter Sheet number <1>:") "1"))) The way this is written you either have sht as 1 or sht as nil?, you might be better to use getint so the user can use any number and then itoa or rtos it to be a string? After that it should work? Quote
BIGAL Posted January 20 Posted January 20 Another problem (strcat fname "_S" sht) (setq fname (strcat fname "_S" sht)) Another problem "Y" ctb "Y" you have not defined ctb ? "Y" acad.ctb "Y" 1 Quote
mjab8 Posted January 21 Author Posted January 21 Thanks Steven and BIGAL. I have tried as attached my .lsp. The filename suffix works on variable flname, but still not in the PDF SaveAs dialog. It still appear without .S5 (as an example) and default with *-Model 1. Could this be an issue with the 'Gaaiho PDF.pc3' which doesn't allow suffix. Please advise. Test.lsp Quote
mjab8 Posted January 21 Author Posted January 21 The reason I am writing this lisp is to do quick plot to PDF, time saving, rather than going through plot dialog box. This is just one of my few plot lisp. This next interest is to add the sheet suffix to the pdf, in MS and layouts. If this lisp is good, it some time saving for me. My pc3 is always Gaaiho PDF, which produce good clear pdf. I only need two prompt, ie. Plot extend or window; Plot with lineweight to suite all drawings. MS or PS is auto-detected with getvar "TILEMODE". Quote
BIGAL Posted January 21 Posted January 21 (edited) This is an example of plot sheet number, actually plot a range for single sheet just have start and end the same. You need to save multi getvals to a support path as its autoloaded. You will need to edit the plot settings. Multi GETVALS.lspplotA3Pdfrange.lsp Edited January 21 by BIGAL Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.