home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p024 / 15.img / AME2.LIB / SOLMAINT.LSP < prev    next >
Encoding:
Text File  |  1993-02-09  |  5.5 KB  |  144 lines

  1. ;;;   SOLMAINT.lsp
  2. ;;;   ¬⌐┼v (C) 1992  Autodesk ñ╜Ñq
  3. ;;;
  4. ;;;   Ñ╗│n┼ΘºK╢O¿╤▒z╢iªµÑ⌠ª≤Ñ╬│~╗▌¿D¬║½■¿⌐íB¡╫º∩ñ╬╡oªµ, ª²¼O░╚╜╨┐φ┤`ñU¡z
  5. ;;;   ¡∞½h :
  6. ;;;
  7. ;;;   1)  ñWªC¬║¬⌐┼v│qºi░╚╗▌ÑX▓{ªb¿Cñ@Ñ≈½■¿⌐∙╪íC
  8. ;;;   2)  ¼█├÷¬║╗í⌐·ñσÑ≤ñ]Ñ▓╢╖⌐·╕ⁿ¬⌐┼v│qºiñ╬Ñ╗╢╡│\Ñi│qºiíC
  9. ;;;
  10. ;;;   Ñ╗│n┼Θ╢╚┤ú¿╤º@¼░└│Ñ╬ñW¬║░╤ª╥, ª╙Ñ╝┴n⌐·⌐╬┴⌠ºtÑ⌠ª≤½O├╥; ╣∩⌐≤Ñ⌠ª≤»S«φ
  11. ;;;   Ñ╬│~ñº╛A║┘⌐╩, ÑHñ╬░╙╖~╛P░Γ⌐╥┴⌠ºtÑX¿π¬║½O├╥, ªbª╣ñ@╖ºñ⌐ÑHº_╗{íC
  12. ;;;
  13. ;;;
  14. ;;;   by Daniel T. Campbell
  15. ;;;      Thanks to Rajiv Jain for providing technical support.
  16. ;;;   Version 0.1               16 April 1991
  17. ;;;   Version 0.2               19 April 1991
  18. ;;;     1. Made all variables local (solset oldent prims n cnt)
  19. ;;;     2. Added wild card (*) to the beginning of AME_FRZ in ssget "x"
  20. ;;;        filter-list.  This is needed for AME inserts on AME_FRZ layers
  21. ;;;        that have been xref'ed and bound.
  22. ;;;   Version 0.3               21 May 1991
  23. ;;;     1. Several minor changes to the documentation.
  24. ;;;     2. Added "/meshes" to the "delete primitive wireframes" prompt.
  25. ;;;   Version 0.4               26 May 1992
  26. ;;;     1. Added SOLUPDATE function.
  27. ;;;
  28. ;;;
  29. ;;;----------------------------------------------------------------------------;
  30. ;;; DESCRIPTION
  31. ;;;
  32. ;;; SOLMAINT.LSP   Contains two functions - SOLMAINT and SOLUPDATE.
  33. ;;;
  34. ;;; SOLMAINT       - Disassociates block definitions from inserts that
  35. ;;;                contain the graphical representation for child nodes
  36. ;;;                of AME 1.0x solids.
  37. ;;;
  38. ;;; For each Boolean performed on a solid, a new wireframe or mesh is
  39. ;;; generated to reflect the solid's feature changes. The insert that
  40. ;;; referenced the previous wireframe block becomes a secondary block
  41. ;;; and is moved to the AME_FRZ layer. A new insert is created for the
  42. ;;; top level node in the CSG tree (main block) and it references a new
  43. ;;; wireframe block which represents the modified solid.
  44. ;;;
  45. ;;; Only one wireframe is required to represent a solid, so the previous
  46. ;;; wireframes are no longer needed and litter the dwg database.
  47. ;;; As long as a wireframe block is referenced it never gets purged.
  48. ;;; SOLMAINT.LSP detaches the inserts from the unwanted wireframes. These
  49. ;;; are anonymous blocks and will get purged automatically upon re-entering
  50. ;;; the drawing.
  51. ;;;
  52. ;;; SOLCHP uses the wireframes of primitives in the CSG tree to display
  53. ;;; primitives, and if the wireframe is not available it re-evaluates the
  54. ;;; boundary file for each primitive. Because of the time penalty associated
  55. ;;; with re-evaluating primitives, deletion of all primitive wireframes
  56. ;;; is optional.
  57. ;;;
  58. ;;; SOLUPDATE      - Automates the process of updating a solid to the
  59. ;;;                  latest values defined by current solvar settings.
  60. ;;;
  61. ;;; Solupdate purges the bfile and memory of the selected solid and then
  62. ;;; invokes the solwire command. This causes the bfile to be reevaluated
  63. ;;; at the current solvar settings. Solupdate can be used to force a
  64. ;;; reevaluation at new solwdens settings. To use, first change the
  65. ;;; solwdens variable. Then use solupdate on the solid to update a new
  66. ;;; wireframe. Solupdate can also be used on regions to reevaluate
  67. ;;; them to use new hatch pattern variables. The bfile is not purged
  68. ;;; if used with the region modeler.
  69.  
  70.  
  71.   (defun C:SOLMAINT (/ solset oldent prims n cnt)
  72.   (initget "Yes No")
  73.   (setq kword (getkword "ºR░ú¡∞Ñ≤íu╜u║c/║⌠║cív? <Y>:"))
  74.   (setq cnt 0)
  75.   (if (setq solset (ssget "X" (list (cons 0 "INSERT")
  76.             (cons 8 "*AME_FRZ")
  77.             (cons 2 "`*U*"))
  78.             ))
  79.       (progn
  80.        (setq n(- (sslength solset) 1))
  81.        (while (> n  -1)
  82.          ; If AME_SOL XED is attached to this entity continue.
  83.          (if
  84.           (= -3 (car (last (setq oldent (entget (ssname solset n)
  85.                        (list "AME_SOL"))))))
  86.           (if
  87.       (not (and
  88.             (/= 7 (logand 255 (cdr (nth 4 (last (last oldent))))))
  89.             (not (or (equal "Yes" kword) (equal nil kword)))))
  90.       (progn
  91.        (entmod (subst (cons 2 "AME_NIL")
  92.             (assoc 2 oldent)
  93.             oldent))
  94.        (setq cnt (1+ cnt))
  95.        )
  96.       )
  97.           )
  98.          (setq n (- n 1))
  99.          )
  100.        )
  101.       )
  102.   (strcat "ª█┼πÑ▄╣╧╕sññ╕╤┬≈ " (itoa cnt) " ╢╡íu┤íñ▐ívíC")
  103.   )
  104. ;;;----------------------------------------------------------------------------;
  105.  
  106. (defun soluperr (s)                   ; If an error (such as CTRL-C) occurs
  107.                                       ; while this command is active...
  108.   (if (/= s "Function cancelled")
  109.     (princ (strcat "\n┐∙╗~: " s))
  110.   )
  111.   (setvar "CMDECHO" ocmd)             ; Restore saved mode
  112.   (setq *error* olderr)               ; Restore old *error* handler
  113.   (princ)
  114. )
  115.  
  116. (defun c:solupdate( / ocmd solid)
  117.  
  118.   (if (not SOLSUB)
  119.     (princ "\n░⌡ªµª╣Ñ\»αñº½e, Ñ▓╢╖Ѳ╕ⁿñJíuAME 2.0ív⌐╬íu¡▒░∞ív╢∞½¼╡{ªííC")
  120.     (progn
  121.       (setq olderr *error*
  122.            *error* soluperr)
  123.       (setq ocmd (getvar "CMDECHO"))
  124.       (setvar "CMDECHO" 0)
  125.  
  126.       (setq solid (car (entsel)))
  127.       (if (null (not SOLBOX))              ;Skip this if running Regions
  128.          (solpurge "bfile" solid "")
  129.       )
  130.       (solpurge "memory" "" solid "")
  131.       (solwire solid "")
  132.  
  133.       (setvar "CMDECHO" ocmd)             ; Restore saved mode
  134.       (setq *error* olderr)               ; Restore old *error* handler
  135.     )
  136.   )
  137.   (princ)
  138. )
  139.  
  140. ;;;----------------------------------------------------------------------------;
  141. (princ "\níuC:SOLMAINTív╗PíuC:SOLUPDATEívñw╕ⁿñJ;")
  142. (princ " ╜╨ÑH SOLMAINT ñ╬ SOLUPDATE ▒╥░╩½ⁿÑOíC")
  143. (princ)
  144.