PDA

View Full Version : Purge AEC Styles


fletch97
2008-03-11, 07:20 PM
I found this code but am having some problems when running it......

(defun C:AECPURGE (/ ITEM)
(foreach ITEM '("-MaskDefine"
"-ProfileDefine"
"-NameDef"
"-GroupTemplate"
"-CalculationModifierStyle"
"-AreaGroupStyle"
"-MemberStyle"
"-AecPolygonStyle"
"-AecDimStyle"
"-WallStyle"
"-DoorStyle"
"-WindowStyle"
"-StairStyle"
"-RailingStyle"
"-SpaceStyle"
"-AecMvBlockDefine")
(progn (if (vl-cmdf ITEM "p" "*" "n")
(vl-cmdf))
(vl-cmdf)))
(princ "\nAll Styles have been purged!")
(princ))


The lisp has issues when there are no styles to purge........

Command: aecpurge
-MaskDefine
Style [New/Copy/Edit/Purge/?]: p
All entries are currently referenced and cannot be purged.
Style [New/Copy/Edit/Purge/?]: *
Invalid option keyword.

Style [New/Copy/Edit/Purge/?]: n
New style name or [?]:
Style [New/Copy/Edit/Purge/?]:
Command: -ProfileDefine
Style [New/Copy/Edit/Purge/?]: p
All entries are currently referenced and cannot be purged.
Style [New/Copy/Edit/Purge/?]: *
Invalid option keyword.


Any ideas? Thanks!

BTW.......this for purging unused AEC styles in ADT / ACA.

Moderator Note:
Please use [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code)

fletch97
2008-03-11, 11:32 PM
This didn't work but am I going in the right direction??



(command "-wallstyle" "p"
(if (= "Styles to purge <*>:")
(progn
("*" "n" "")
)
)
(if (= "All entries are currently referenced and cannot be purged.")
(progn
("")
)
)
)

Moderator Note:
Please use [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code)

burchd
2008-04-23, 06:25 PM
I am looking for a solution to this also...

I will post some example code.

Regarding this, dont the ITEMS have to be in a list form? Its looking like the for each is trying to run on each condition.

ie
(defun C:AECPURGE (/ ITEM)

< something in here to create the ITEM list.... ("-MaskDefine"
"-ProfileDefine"
"-AecMvBlockDefine")
(foreach ITEM)
(progn (if (vl-cmdf ITEM "p" "*" "n")
(vl-cmdf))
(vl-cmdf))
)
)

(princ "\nAll Styles have been purged!")
(princ))

Moderator Note:
Please use [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code)