马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
按 lzh 版主这个函数http://bbs.xdcad.net/forum.php?m ... 646&pid=3528129用 XdGe 库函数改写成 Lisp,Line Circle Arc Ellipse 正常,Spline Lwpolyline 错误
- (defun GetSubCurve (ge from to / in atStart atEnd clone nin)
- (setq in (car (xdge::getpropertyvalue ge "getInterval"))
- atStart (equal (xdge::getpropertyvalue in "lowerBound")
- to
- (car (xdrx_document_getprec))
- )
- atEnd (equal (xdge::getpropertyvalue in "upperBound")
- from
- (car (xdrx_document_getprec))
- )
- )
- (cond
- ((and atStart atEnd) ge)
- ((= (xdge::type ge) "kNurbCurve3d")
- (if (< from to)
- (progn
- (if (or atStart atEnd)
- (progn
- (xdge::setpropertyvalue ge "hardTrimByParams" from to)
- ge
- )
- (progn
- (xdge::setpropertyvalue
- ge
- "hardTrimByParams"
- (xdge::getpropertyvalue "lowerBound")
- to
- )
- (xdge::setpropertyvalue ge "hardTrimByParams" from to)
- ge
- )
- )
- )
- (progn
- (setq clone (xdge::copy ge))
- (xdge::setpropertyvalue
- ge
- "hardTrimByParams"
- from
- (xdge::getpropertyvalue in "upperBound")
- )
- (xdge::setpropertyvalue
- clone
- "hardTrimByParams"
- (xdge::getpropertyvalue in "lowerBound")
- to
- )
- (xdge::setpropertyvalue ge "joinWith" clone)
- ge
- )
- )
- )
- (t
- (setq nin (xdge::constructor "AcGeInterval" from to))
- (xdge::setpropertyvalue ge "setInterval" nin)
- ge
- )
- )
- )
- (defun c:tt (/ e p1 p2 ge from to clone)
- (if (and (setq e (entsel))
- (setq p1 (cadr e))
- (setq p2 (getpoint p1 "\nSecond point: "))
- (setq ge (xdge::constructor (car e)))
- (setq from (xdge::getpropertyvalue
- ge
- "paramOf"
- (xdge::getpropertyvalue ge "closestPointTo" p1)
- )
- to (xdge::getpropertyvalue
- ge
- "paramOf"
- (xdge::getpropertyvalue ge "closestPointTo" p2)
- )
- )
- )
- (progn
- (setq clone (GetSubCurve ge from to))
- (xdge::entity:make clone)
- (xdrx_entity_setcolor (entlast) 1)
- (vl-cmdf ".move" "l" "" p1)
- )
- )
- (princ)
- )
|