Author Topic: [XDrX-PlugIn(88)] SOLID to HATCH  (Read 286 times)

0 Members and 1 Guest are viewing this topic.

xdcad

  • Swamp Rat
  • Posts: 514
[XDrX-PlugIn(88)] SOLID to HATCH
« on: January 09, 2024, 07:38:08 PM »
Code: [Select]
(defun c:XDTB_SOLID2HA (/ verts ss)
  (if (setq ss (xdrx-ssget
(xdrx-string-multilanguage
   "\n选择SOLID<退出>:"
   "\nSelect Solid<Exit>:"
)
'((0 . "SOLID"))
       )
      )
    (progn
      (xdrx-begin)
      (mapcar
'(lambda (x)
   (setq verts (xdrx-getpropertyvalue x "vertices")
verts (list (nth 0 verts)
     (nth 1 verts)
     (nth 3 verts)
     (nth 2 verts)
       )
   )
   (setq ss (xdrx-hatch-make verts))
   (xdrx-entity-matchprop x ss)
   (xdrx-entity-delete x)
)
(xdrx-ss->ents ss)
      )
      (xdrx-end)
    )
  )
  (princ)
)
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net