Author |
Topic |
|
BFritch
Starting Member
3 Posts |
Posted - July 05 2007 : 09:35:10 AM
|
While in Paperspace so I can batch publish drawings either to a plotter or PDF file, I need to ensure that the Viewport layers don't plot or can be frozen. Since we continuously work for different clients these layers are never named the same. Is there a way I can search for a viewport and subsequently filter or freeze that layer and then publish to "extents"? Thanks for the help! |
|
Admin
Administrator
652 Posts |
Posted - July 05 2007 : 4:21:55 PM
|
Hi,
Without the layers being named the same, it's quite difficult to manage things. Are there any consistencies between your customers you can capitalize on? If there are no consistencies, then you will have to resort to finding/writing a lisp that will somehow do this. I hope that someone else might chime-in here and give you some better news!
Regards, Bill |
Hurricane for AutoCAD http://www.74mph.com FAQ at http://www.74mph.com/faq/faq.html Tutorials at http://www.74mph.com/tutorials.html |
|
|
n/a
deleted
112 Posts |
Posted - July 05 2007 : 9:50:44 PM
|
The attached file needs to be renamed with an LSP file extension in lieu of the TXT file extension. The lisp file will thaw and unlock all layers, then find all "Viewport" entities. It will extract the layer information from each entity, and then set that layer to "NoPlot". Finally, it zooms to the extents of the drawing.
Instructions are included in the file for modification to freezing the layers rather than setting them to "NoPlot". This is quick and dirty. It does not reset the layer status to what it was before running the lisp file. If entities other than viewports are on the same layer as the viewports, they will be frozen or will not plot based on the layer's "NoPlot" setting. I don't know how "bullet-proof" this routine will be in another drawing environment, particularly since I don't use paperspace much. Back up your files before running and please use at your own risk.
I'm short on time here. Hopefully Bill will be able to jump back in here and instruct on how to load and run the lisp file.
Download Attachment: VPLayerNoPlot.txt 1.02 KB |
Steve Bubendorf
|
|
|
Admin
Administrator
652 Posts |
Posted - July 05 2007 : 11:10:03 PM
|
Thanks Steve!
The code to load and run the lisp is as follows...
;START SCRIPT
(LOAD "C:/PROGRAM FILES/AUTOCAD/SUPPORT/VPLayerNoPlot.LSP")
VPLAYERNOPLOT
;END SCRIPT
(Of course you will need to download and rename the file as Steve instructs, to a known directory (preferably your /SUPPORT/ directory), then edit the path above (you can also just use the "Load Lisp" button in Hurricane to create the line of code (found in the "Editor"), navigate to the lsp file and it will create the line of script for you)
You can then append your PLOT script, presto, you should be groovin.
I hope this gets you going! Thanks again Steve!
Regards, Bill |
Hurricane for AutoCAD http://www.74mph.com FAQ at http://www.74mph.com/faq/faq.html Tutorials at http://www.74mph.com/tutorials.html |
|
|
BFritch
Starting Member
3 Posts |
Posted - July 06 2007 : 08:19:27 AM
|
Thanks for the help. I will try as you have described. |
|
|
BFritch
Starting Member
3 Posts |
Posted - July 06 2007 : 08:50:32 AM
|
"ssget"? "sslength"? "ssname"?
Three items within your lisp file that I don't understand. I am currently working with ACAD 2006. Could you explain their use? |
|
|
n/a
deleted
112 Posts |
Posted - July 06 2007 : 09:32:26 AM
|
All 3 of the items you questioned are AutoLisp functions. They are not AutoCAD commands perse'. The help file in AutoCAD will probably provide you with an option to view an AutoLisp reference that can give you more detailed info.
ssget gets a selection set. The "X" portion includes the entire drawing database without requiring the user to pick, window, etc. The '((0 . "VIEWPORT")) restricts the selection set to Viewport entities.
sslength returns the number of entities in selection set a1.
ssname returns the name of an entity in selection set a1.
index is basically a counter. The first time thru the repeat loop, it is set to 0, so ssname returns the first item in the list. Each time thru the loop, the index is increased by one, so ssname returns the name of the next entity in the selection set. The repeat loop runs a number of times to match the number of entities (sslength a1).
entget returns an entity data list similar to the following: ((-1 . <Entity name: 7efb8e78>) (0 . "VIEWPORT") (330 . <Entity name: 7efb8d98>) (5 . "4F") (100 . "AcDbEntity") (67 . 1) (410 . "Layout1") (8 . "Vport1") (100 . "AcDbViewport") (10 8.01632 3.82358 0.0) (40 . 4.70291) (41 . 4.41456) (68 . 2) (69 . 2) (12 6.55506 5.45326 0.0) (13 0.0 0.0 0.0) (14 0.5 0.5 0.0) (15 0.5 0.5 0.0) (16 0.0 0.0 1.0) (17 0.0 0.0 0.0) (42 . 50.0) (43 . 0.0) (44 . 0.0) (45 . 2.95897) (50 . 0.0) (51 . 0.0) (72 . 1000) (90 . 819296) (281 . 0) (71 . 1) (74 . 0) (110 0.0 0.0 0.0) (111 1.0 0.0 0.0) (112 0.0 1.0 0.0) (79 . 0) (146 . 0.0) (170 . 0) (61 . 5) (348 . <Entity name: 7efb8cd0>) (292 . 1) (282 . 1) (141 . 0.0) (142 . 0.0) (63 . 250) (421 . 3355443))
assoc 8 returns a list similar to (8. "Vport1") from the list above. 8 refers to layer information.
cdr returns just the "Vport1" portion, the actual layer name.
And so on, I guess.
I hope the lisp and the explanation help !! |
Steve Bubendorf
|
|
|
|
Topic |
|