(XDGE几何库应用-35)多段线局部双偏移
本帖最后由 newer 于 2017-5-18 00:01 编辑(defun c:tt ()
(and
(setq e (car (xdrx_entsel "\n选取多段线<退出>:" '((0 . "LWPOLYLINE")))))
(setq dis (getreal "\n输入偏移距离<退出>:"))
(setq p1 (getpoint "\n起始点<退出>:"))
(setq p1 (trans p1 1 0))
(setq p1 (xdrx_curve_getclosestpoint e p1))
(setq p2 (getpoint p1 "\n第二点<退出>:"))
(xdrx_begin)
(setq p2 (trans p2 1 0))
(setq p2 (xdrx_curve_getclosestpoint e p2))
(setq g (xd::curve:getsub e p1 p2 p1))
(setq normal (xdrx_getpropertyvalue e "normal"))
(setq g1 (xd::vla:catchapply 'xdge::getpropertyvalue (list g "getTrimmedOffset"
dis normal 2
)
)
)
(setq g2 (xd::vla:catchapply 'xdge::getpropertyvalue (list g "getTrimmedOffset"
(- dis)
normal 2
)
)
)
(setq ss (xdge::entity:make g1 g2))
(mapcar
'(lambda (x)
(xdrx_entity_setpropertiesfrom x e)
)
(xdrx_pickset->ents ss)
)
(xdge::free g g1 g2)
(xdrx_end)
)
(princ)
)
真的好厉害啊!!! 好厉害啊!!! 牛逼~~~~~~~~~~ 谢谢楼主分享 测试报错,不知何故,提示如下:
错误: 函数错误: FOO
页:
[1]