Author |
Topic |
|
ktumack
Starting Member
3 Posts |
Posted - November 09 2005 : 12:26:02 PM
|
Is there anyone out there that can help me develop a LISP or script that removes all intelligent aspects of a AutoCAD2005 drawing. These AutoCAD files are provided to clients as there electronic version of thier documentation rather then getting PDF's.
Task's this program would need to do: 1.) erase all nodes 2.) burst all blocks to their basic elements, and yet retain there layer name, color and line type. 3.) move all objects to layer 0, object property for the linetype is retained (if object line is bylayer, and the layer is set to hidden then the line must be forced to hidden line type, etc.) 4.) color of all objects changed to bylayer. 5.) all dim's exploded. 6.) blocks with visible attributes converted to text. 7.) blocks with invisible attributes deleted. 8.) dwg purged of all layers, linetypes, styles. 9.) could be command prompt executed or dialog box controled.
The final dwg must look just like the original except with no AutoCAD intelligence and every object on the layer "0" with forced linetypes, bylayer color setting so all objects are the same color. The dwg would look just like a plotted dwg with black lines on a white paper.
Thanks.........Ken |
|
Admin
Administrator
652 Posts |
Posted - November 09 2005 : 12:49:51 PM
|
Hi ktumack,
I think the BURST lisp will get you halfway there, then follow it up with a FLATTEN.
; start of script
burst
all
;end of script
http://www.74mph.com/forum/topic.asp?TOPIC_ID=42&SearchTerms=flatten (script depends on the one you use)
You can move them all to layer 0
; start of script
; MOVE EVERYTHING TO LAYER '0'
CHANGE
; SELECT ENTITIES
ALL
; SELECT PROPERTIES
P
; [Color/Elev/LAyer/LType/
; ltScale/LWeight/Thickness]
LA
;LAYER NAME
0
;end of script
Repeat for Color...
Perform a purge... no problem
;START OF SCRIPT
;PURGE ALL UNUSED
_PURGE
_A
*
_N
;END OF SCRIPT
Let me know if this gets you close to what you need. I'm sure it can be done in a couple more simple steps...
Of course the method described would be all put together in Hurricane, as putting this into a Dialog Box would restrict its "batchability"... (if that is even a word?! )
Regards, Bill
|
|
|
ktumack
Starting Member
3 Posts |
Posted - November 09 2005 : 1:05:39 PM
|
Thanks, But how would I force all linetypes from bylayer to layer type before moving all objects to layer "0"
Ken |
|
|
Admin
Administrator
652 Posts |
Posted - November 09 2005 : 7:49:04 PM
|
Hi ktumack,
I think the best way would be to use the CHANGE command.
Here is an example script... providing you have linetype called HIDDEN and you want to change it to BYLAYER for ALL entities. (I've just used Hurricanes Command Capture Utility found under Tools->Utilities)
;BEGIN SCRIPT
;Command: CHANGE
CHANGE
;Select objects: ALL
ALL
;Select objects:
;Specify change point or [Properties]: P
P
;Enter property to change [Color/Elev/LAyer/LType/ltScale/LWeight/Thickness]: LT
LT
;Enter new linetype name <varies>: BYLAYER
BYLAYER
;Enter property to change [Color/Elev/LAyer/LType/ltScale/LWeight/Thickness]:
;END SCRIPT
You could use the CHANGE command to do all sorts of things... (including move everything to layer 0)
I hope this helps!!
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 |
|
|
ktumack
Starting Member
3 Posts |
Posted - November 10 2005 : 12:22:26 PM
|
Thanks Admin,
But I need to go in the opposite way. I need to find a line types prop. either forced or bylayer and change it to a forced line type. |
|
|
Admin
Administrator
652 Posts |
Posted - November 10 2005 : 4:39:47 PM
|
I see...
In that case, I can recommend a little lisp calld SSX, and with it, you can have it select all entities that match certain criteria. http://www.74mph.com/forum/topic.asp?TOPIC_ID=51&SearchTerms=ssx http://www.74mph.com/forum/topic.asp?TOPIC_ID=82&SearchTerms=ssx It may take a little playing with, to get used to, but basically you run it, and tell it what to select, as it generates a selection set. Then the command is exited.
Then you perform a command to CHANGE, and when asked to "select objects:" then enter "P" (for PREVIOUS selection set), then enter P for Properties, and then type LT for LineType, and enter BYLAYER.
In the example below, I am filtering using SSX to select items with LineType "BORDER" and change them to "BYLAYER".
Something like this...
;BEGIN SCRIPT
(LOAD "D:/PROGRAM FILES/AUTOCAD/SUPPORT/SSX.LSP") <-Make sure SSX.LSP is loaded
;Command: SSX
SSX
;Select object/<None>:
;>>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector: LT
LT
;>>Linetype name to add/<RETURN to remove>: BORDER
BORDER
;Filter: ((6 . "BORDER"))
;((6 . "BORDER"))
;>>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
;Command: CHANGE
CHANGE
;Select objects: P
P
;Select objects:
;Specify change point or [Properties]: P
P
;Enter property to change [Color/Elev/LAyer/LType/ltScale/LWeight/Thickness]: LT
LT
;Enter new linetype name <BORDER>: BYLAYER
BYLAYER
;Enter property to change [Color/Elev/LAyer/LType/ltScale/LWeight/Thickness]:
;END SCRIPT
I hope this gets you closer!
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 |
|
|
|
Topic |
|