home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p024 / 5.img / SUPPORT3.LIB / PLUD.LSP < prev    next >
Encoding:
Text File  |  1993-02-09  |  3.3 KB  |  93 lines

  1. ;;;---------------------------------------------------------------------------;
  2. ;;;
  3. ;;;   PLUD.LSP   ¬⌐Ñ╗ 0.5
  4. ;;;
  5. ;;;   (C) ¬⌐┼v 1988-1992  Autodesk ñ╜Ñq
  6. ;;;
  7. ;;;   Ñ╗╡{ªíñwÑ╤ Autodesk ñ╜Ñq╡∙ÑU¬⌐┼v, ╢╚⌐≤ñU¡z▒í¬pñUÑi▒┬╗P▒zíu│\ÑiívíC
  8. ;;;   ╗╒ñUñú▒oÑHÑ⌠ª≤º╬ªí╡oªµ⌐╬ÑX¬⌐ª╣╡{ªí¬║íu¡∞⌐l╜Xív; ª²ñ╣│\▒zªb»S⌐w¡lÑ═
  9. ;;;   ¬║ñuº@ñW╡▓ªXª╣╡{ªí¬║íuÑ╪¬║╜Xív¿╧Ñ╬íCª│├÷│o├■¡lÑ═ñuº@¬║▒°Ñ≤ªpñU:
  10. ;;;
  11. ;;;   ( i)  │]¡pñW╗Pñuº@ñW¼╥»┬║Θ░w╣∩ Autodesk ñ╜Ñq¬║▓ú½~íC
  12. ;;;   (ii)  ╕ⁿª│íu¬⌐┼v  (C) 1988-1992  Autodesk ñ╜Ñqív¬║¬⌐┼v│qºiíC
  13. ;;;
  14. ;;;
  15. ;;;
  16. ;;;   AUTODESKñ╜Ñq┤ú¿╤ª╣╡{ªí╢╚¿╤º@íu├■ªⁿív¬║░╤ª╥, ª╙ÑBñú▒╞░úª│Ñ⌠ª≤┐∙╗~¬║
  17. ;;;   Ñi»αíCAUTODESKñ╜Ñq»Sª╣º_╗{Ñ⌠ª≤»S⌐wÑ╬│~ñº╛A║┘⌐╩, ÑHñ╬░╙╖~╛P░Γ⌐╥┴⌠ºt
  18. ;;;   ÑX¿π¬║½O├╥íCAUTODESKñ╜ÑqªP«╔ÑτñúÑX¿πª╣╡{ªí░⌡ªµ«╔ñ@⌐wñú╖|íuññ┬_ív⌐╬
  19. ;;;   íuº╣Ñ■╡L╗~ív¬║½O├╥íC
  20. ;;;
  21. ;;;
  22. ;;;   by Kieran V. McKeogh
  23. ;;;   22 October 1991
  24. ;;;
  25. ;;;---------------------------------------------------------------------------;
  26. ;;;  DESCRIPTION
  27. ;;;
  28. ;;;  An AutoLISP routine allowing users to toggle the selected polylines
  29. ;;;  between the two modes of linetype generation, either generation
  30. ;;;  between the vertices or the new method, along the complete polyline.
  31. ;;;
  32. ;;;---------------------------------------------------------------------------;
  33.  
  34. ;;;---------------------------------------------------------------------------;
  35. ;;; Internal error handler.
  36. ;;;---------------------------------------------------------------------------;
  37.  
  38. (defun plud_err (s)                   ;If an error (such as CTRL-C) occurs
  39.                                       ;while this command is active...
  40.   (if (/= s "Function cancelled")
  41.     (princ (strcat "\n┐∙╗~: " s))
  42.   )
  43.   (setq *error* old_err)              ;Restore old *error* handler
  44.   (princ)
  45. )
  46. ;;;---------------------------------------------------------------------------;
  47.  
  48. ;;;---------------------------------------------------------------------------;
  49. ;;; The Main Function.
  50. ;;;---------------------------------------------------------------------------;
  51.  
  52. (defun c:plud(/ a method plud_ss pline_info old new)
  53.  
  54.   (setq old_err *error*            ; Use special error handling function.
  55.         *error* plud_err)
  56.  
  57.   (initget "Full Segment")
  58.   (setq method (getkword "FÑ■│í/S▓╒¼q <FÑ■│í>: "))
  59.   (setq a 0)
  60.   (cond
  61.     ((= "Segment" method)          ; find all polylines with 128 bit set
  62.       (setq plud_ss
  63.               (ssget (list (cons 0 "POLYLINE")(cons -4 "&=")(cons 70 128)))
  64.       )
  65.     )
  66.     (T                             ; find all 2D polylines with 128 bit not set
  67.       (setq plud_ss (ssget (list (cons 0 "POLYLINE")
  68.                                  (cons -4 "<NOT")
  69.                                     (cons -4 "&")(cons 70 248)
  70.                                  (cons -4 "NOT>")
  71.       )))
  72.     )
  73.   )
  74.   (if plud_ss
  75.     (progn
  76.       (while (< a (sslength plud_ss))
  77.         (setq pline_info (entget (ssname plud_ss a)))
  78.         (setq old (assoc '70 pline_info))
  79.         (if (= "Segment" method)
  80.           (setq new (cons 70 (logand (cdr old) (~ 128))))  ; remove 128 bit
  81.           (setq new (cons 70 (logior (cdr old) 128)))  ; add 128 bit
  82.         )
  83.         (entmod (subst new old pline_info))
  84.         (setq a (1+ a))
  85.       )
  86.     )
  87.   )
  88.   (princ (strcat (itoa a) " ▒°íu╗EªX╜uívº≤╖síC"))
  89.   (princ)
  90. )
  91.  
  92. ;;;---------------------------------------------------------------------------;
  93.