Author Topic: [XDrX-PlugIn(59)] HATCH Boolean operations, intersection, union, subtract  (Read 725 times)

0 Members and 1 Guest are viewing this topic.

xdcad

  • Bull Frog
  • Posts: 479
Code: [Select]
(defun c:XDTB_HaBoolean (/ oper ha1 ha2)
  (if (and (xdrx-initget "A F G")
   (setq oper
  (getkword
    (xdrx-string-multilanguage
      "\n操作方式[交(A)/差(F)/并(G)]<Exit>:"
      "\nOperation Method [Intersect(A)/Subtract(F)/Union(G)]<Exit>:"
    )
  )
   )
   (setq ha1 (car (xdrx-entsel
     (xdrx-string-multilanguage
       "\n选择第一个填充<退出>:"
       "\nPick First Hatch<Exit>:"
     )
     '((0 . "hatch"))
   )
      )
   )
      )
    (progn
      (xdrx-begin)
      (while (and
       (xdrx-entity-redraw ha1 3)
       (setq ha2 (car (xdrx-entsel
(xdrx-string-multilanguage
   "\n选择第二个填充<退出>:"
   "\nPick Second Hatch<Exit>:"
)
'((0 . "hatch"))
       )
  )
       )
     )
(cond
  ((= oper "A")
   (xdrx-get-intersect ha1 ha2)
  )
  ((= oper "F")
   (xdrx-get-subtract ha1 ha2)
  )
  ((= oper "G")
   (xdrx-get-union ha1 ha2)
  )
)
(princ)
      )
      (xdrx-entity-redraw ha1)
      (xdrx-end)
    )
  )
  (princ)
)
« Last Edit: December 23, 2023, 11:02:55 PM by xdcad »
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
[XDrx-Sub Forum]
https://www.theswamp.org/index.php?board=78.0
https://github.com/xdcad/XDrx-API
http://bbs.xdcad.net