Code Red > XDRX-API
[XDrX-PlugIn(151)] Exploded Hatch and kept Hatch lines as continuous polyline
(1/1)
xdcad:
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-explode-a-hatch-into-polylines/m-p/12711700
============
Normally, after the Hatch is exploded, the Hatch lines are "broken" straight lines. The following code turns them into continuous polylines.
--- Code: ---(defun c:xdtb_haexplode (/ ss a)
(xdrx-begin)
(xd::doc:getdouble
(xdrx-string-multilanguage "\n缝隙容差" "\nGap tolerance")
"#xd-var-global-gap-tol"
0.1
)
(xdrx-sysvar-push
(list "DistanceTol" #xd-var-global-gap-tol)
)
(if (setq ss (xdrx-ssget
(xdrx-string-multilanguage
"\n选择要炸开的填充<退出>:"
"\nSelect The Hatch to explode<Exit>:"
)
'((0 . "hatch"))
)
)
(progn
(mapcar '(lambda (x)
(setq a (xdrx-entity-explode t ss))
(xdrx-curve-join a)
)
(xdrx-ss->ents ss)
)
(xdrx-prompt
(xdrx-string-formatex
(xdrx-string-multilanguage
"\n炸开了 %d 个填充,并保持填充线为连续的多段线."
"\nExploded %d Hatch and kept Hatch lines as continuous polylines."
)
(sslength ss)
)
)
)
)
(xdrx-sysvar-pop)
(xdrx-end)
(princ)
)
--- End code ---
Navigation
[0] Message Index
Go to full version