Author Topic: [XDrX-PlugIn(52)] Hatch the dug hole (Append Loop)  (Read 1112 times)

0 Members and 1 Guest are viewing this topic.

xdcad

  • Swamp Rat
  • Posts: 514
[XDrX-PlugIn(52)] Hatch the dug hole (Append Loop)
« on: December 18, 2023, 01:58:56 PM »
Code: [Select]
(defun c:XDTB_HaDugHoles (/ e ss i nums)
  (xdrx_begin)
  (if (and
(setq e
       (car
(xdrx_entsel
   (if (xd::doc:acadischs)
     "\n请点取HATCH实体<退出>:"
     "\nPlease Pick HATCH Entity <Exit>:"
   )
   '((0 . "hatch"))
)
       )
)
(xdrx-entity-redraw e 3)
(setq ss
       (xdrx_ssget
(if (xd::doc:acadischs)
   "\n选取要添加到HATCH环(挖洞)的实体<退出>:"
   "\nSelect Entities to add to the HATCH Loop (Burrowing) <Exit>:"
)
'((0 . "*line,arc,circle,ellipse"))
       )
)
      )
    (progn
      (setq i 0 nums (sslength ss))
      (mapcar
'(lambda (x)
   (if (not (xdrx-curve-isclosed x))
     (xdrx-curve-setclosed x)
   )
   (if (xdrx-get-subtract e x)
     (setq i (1+ i))
   )
)
(xdrx-ss->ents ss)
      )
      (xdrx-prompt
(xdrx-string-formatex
  (if (xd::doc:acadischs)
    "\n选择了 %d 曲线,挖了 %d 个洞。"
    "\nSelected %d curves and dug %d holes."
  )
  nums
  i
)
      )
    )
  )
  (xdrx_end)
  (princ)
)
« Last Edit: December 18, 2023, 03:40:41 PM by xdcad »
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