LISP Attribute Extraction Assistance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I could really use some help with a LISP that I'm trying to write. I need to speed up my plotting, and I want to plot PDF's with filenames derived from attributes in the titleblock.
So far I've managed to get the lisp cycling through the layouts and plotting each correctly, but despite my best efforts I cannot extract the attribute information. I've tried Lee-Mac's examples, and countless others....but the results continue to elude me. I just don't understand the syntax enough/correctly.
If anyone could help out I'd very much appreciate it.
Info:
I have multiple (number varies) paperspace layouts within a drawing.
Each layout has a titleblock called "Title" containing a number of attributes (the titleblock name and tag names are fixed and never change).
I need to extract four of the attributes (lets call them A, B, C and D) and use them for the filename of the PDF, which needs to be in the format "A - B - C - D".
I need to cycle through the layouts, plotting a PDF for each.
The code below is what I have so far. It works fine, but I just need to get "pdfname = A - B - C - D" populated with the attributes
(defun c:PlotAllSheets () ;LISP name
(foreach lay (layoutlist) ;Cycle through all layouts
pdfname = A - B - C - D
(setvar 'CTab lay)
(COMMAND "-PLOT" ;Invoke plot command
"Y" ;Detailed plot configuration?
"" ;Layout name
"AutoCAD PDF (General Documentation).pc3" ;Output device
"ISO Full Bleed A1 (841.00 x 594.00 MM)" ;Paper size
"M" ;Paper units
"L" ;Drawing orientation
"N" ;Upside down
"W" ;Window
"1.1638,568.0192" ;Window start coordinates
"823.2229,-11.1902" ;Window end coordinates
"1:1" ;Plot scale
"C" ;Center
"N" ;Plot with plot style
"monochrome.ctb" ;Plot style
"Y" ;Plot line weights
"N" ;Plot line scaling
"N" ;Paper space first
"N" ;Hide?
pdfname ;Name of file
"N" ;Directory to save
"y") ;Save changes to page setup
)
)