home *** CD-ROM | disk | FTP | other *** search
- ;;; SOLMAINT.lsp
- ;;; ¬⌐┼v (C) 1992 Autodesk ñ╜Ñq
- ;;;
- ;;; Ñ╗│n┼ΘºK╢O¿╤▒z╢iªµÑ⌠ª≤Ñ╬│~╗▌¿D¬║½■¿⌐íB¡╫º∩ñ╬╡oªµ, ª²¼O░╚╜╨┐φ┤`ñU¡z
- ;;; ¡∞½h :
- ;;;
- ;;; 1) ñWªC¬║¬⌐┼v│qºi░╚╗▌ÑX▓{ªb¿Cñ@Ñ≈½■¿⌐∙╪íC
- ;;; 2) ¼█├÷¬║╗í⌐·ñσÑ≤ñ]Ñ▓╢╖⌐·╕ⁿ¬⌐┼v│qºiñ╬Ñ╗╢╡│\Ñi│qºiíC
- ;;;
- ;;; Ñ╗│n┼Θ╢╚┤ú¿╤º@¼░└│Ñ╬ñW¬║░╤ª╥, ª╙Ñ╝┴n⌐·⌐╬┴⌠ºtÑ⌠ª≤½O├╥; ╣∩⌐≤Ñ⌠ª≤»S«φ
- ;;; Ñ╬│~ñº╛A║┘⌐╩, ÑHñ╬░╙╖~╛P░Γ⌐╥┴⌠ºtÑX¿π¬║½O├╥, ªbª╣ñ@╖ºñ⌐ÑHº_╗{íC
- ;;;
- ;;;
- ;;; by Daniel T. Campbell
- ;;; Thanks to Rajiv Jain for providing technical support.
- ;;; Version 0.1 16 April 1991
- ;;; Version 0.2 19 April 1991
- ;;; 1. Made all variables local (solset oldent prims n cnt)
- ;;; 2. Added wild card (*) to the beginning of AME_FRZ in ssget "x"
- ;;; filter-list. This is needed for AME inserts on AME_FRZ layers
- ;;; that have been xref'ed and bound.
- ;;; Version 0.3 21 May 1991
- ;;; 1. Several minor changes to the documentation.
- ;;; 2. Added "/meshes" to the "delete primitive wireframes" prompt.
- ;;; Version 0.4 26 May 1992
- ;;; 1. Added SOLUPDATE function.
- ;;;
- ;;;
- ;;;----------------------------------------------------------------------------;
- ;;; DESCRIPTION
- ;;;
- ;;; SOLMAINT.LSP Contains two functions - SOLMAINT and SOLUPDATE.
- ;;;
- ;;; SOLMAINT - Disassociates block definitions from inserts that
- ;;; contain the graphical representation for child nodes
- ;;; of AME 1.0x solids.
- ;;;
- ;;; For each Boolean performed on a solid, a new wireframe or mesh is
- ;;; generated to reflect the solid's feature changes. The insert that
- ;;; referenced the previous wireframe block becomes a secondary block
- ;;; and is moved to the AME_FRZ layer. A new insert is created for the
- ;;; top level node in the CSG tree (main block) and it references a new
- ;;; wireframe block which represents the modified solid.
- ;;;
- ;;; Only one wireframe is required to represent a solid, so the previous
- ;;; wireframes are no longer needed and litter the dwg database.
- ;;; As long as a wireframe block is referenced it never gets purged.
- ;;; SOLMAINT.LSP detaches the inserts from the unwanted wireframes. These
- ;;; are anonymous blocks and will get purged automatically upon re-entering
- ;;; the drawing.
- ;;;
- ;;; SOLCHP uses the wireframes of primitives in the CSG tree to display
- ;;; primitives, and if the wireframe is not available it re-evaluates the
- ;;; boundary file for each primitive. Because of the time penalty associated
- ;;; with re-evaluating primitives, deletion of all primitive wireframes
- ;;; is optional.
- ;;;
- ;;; SOLUPDATE - Automates the process of updating a solid to the
- ;;; latest values defined by current solvar settings.
- ;;;
- ;;; Solupdate purges the bfile and memory of the selected solid and then
- ;;; invokes the solwire command. This causes the bfile to be reevaluated
- ;;; at the current solvar settings. Solupdate can be used to force a
- ;;; reevaluation at new solwdens settings. To use, first change the
- ;;; solwdens variable. Then use solupdate on the solid to update a new
- ;;; wireframe. Solupdate can also be used on regions to reevaluate
- ;;; them to use new hatch pattern variables. The bfile is not purged
- ;;; if used with the region modeler.
-
-
- (defun C:SOLMAINT (/ solset oldent prims n cnt)
- (initget "Yes No")
- (setq kword (getkword "ºR░ú¡∞Ñ≤íu╜u║c/║⌠║cív? <Y>:"))
- (setq cnt 0)
- (if (setq solset (ssget "X" (list (cons 0 "INSERT")
- (cons 8 "*AME_FRZ")
- (cons 2 "`*U*"))
- ))
- (progn
- (setq n(- (sslength solset) 1))
- (while (> n -1)
- ; If AME_SOL XED is attached to this entity continue.
- (if
- (= -3 (car (last (setq oldent (entget (ssname solset n)
- (list "AME_SOL"))))))
- (if
- (not (and
- (/= 7 (logand 255 (cdr (nth 4 (last (last oldent))))))
- (not (or (equal "Yes" kword) (equal nil kword)))))
- (progn
- (entmod (subst (cons 2 "AME_NIL")
- (assoc 2 oldent)
- oldent))
- (setq cnt (1+ cnt))
- )
- )
- )
- (setq n (- n 1))
- )
- )
- )
- (strcat "ª█┼πÑ▄╣╧╕sññ╕╤┬≈ " (itoa cnt) " ╢╡íu┤íñ▐ívíC")
- )
- ;;;----------------------------------------------------------------------------;
-
- (defun soluperr (s) ; If an error (such as CTRL-C) occurs
- ; while this command is active...
- (if (/= s "Function cancelled")
- (princ (strcat "\n┐∙╗~: " s))
- )
- (setvar "CMDECHO" ocmd) ; Restore saved mode
- (setq *error* olderr) ; Restore old *error* handler
- (princ)
- )
-
- (defun c:solupdate( / ocmd solid)
-
- (if (not SOLSUB)
- (princ "\n░⌡ªµª╣Ñ\»αñº½e, Ñ▓╢╖Ѳ╕ⁿñJíuAME 2.0ív⌐╬íu¡▒░∞ív╢∞½¼╡{ªííC")
- (progn
- (setq olderr *error*
- *error* soluperr)
- (setq ocmd (getvar "CMDECHO"))
- (setvar "CMDECHO" 0)
-
- (setq solid (car (entsel)))
- (if (null (not SOLBOX)) ;Skip this if running Regions
- (solpurge "bfile" solid "")
- )
- (solpurge "memory" "" solid "")
- (solwire solid "")
-
- (setvar "CMDECHO" ocmd) ; Restore saved mode
- (setq *error* olderr) ; Restore old *error* handler
- )
- )
- (princ)
- )
-
- ;;;----------------------------------------------------------------------------;
- (princ "\níuC:SOLMAINTív╗PíuC:SOLUPDATEívñw╕ⁿñJ;")
- (princ " ╜╨ÑH SOLMAINT ñ╬ SOLUPDATE ▒╥░╩½ⁿÑOíC")
- (princ)