马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 st788796 于 2014-11-1 08:02 编辑
较为综合应用
![](source/plugin/imc_colorcode/images/loading.gif) - (defun c:tt1 (/ HighlightSeg e ge gel i p cl disl distL indexl plan)
- (defun HighlightSeg (ge gel i / gCurve in lower upper pams)
- (setq gCurve (nth i gel)
- in (car (xdge::getpropertyvalue gCurve "getInterval"))
- lower (xdge::getpropertyvalue in "lowerBound")
- upper (xdge::getpropertyvalue in "upperBound")
- )
- (if (= (xdge::type gCurve) "kLineSeg2d")
- (grdraw (xdge::getpropertyvalue gCurve "startPoint")
- (xdge::getpropertyvalue gCurve "endPoint")
- 1
- )
- (progn
- (setq pams (xdge::getpropertyvalue
- gCurve "getSamplePoints" lower upper 0.1)
- pams (mapcar
- '(lambda (x)
- (xdge::getpropertyvalue ge "localToGlobalParam" x i)
- )
- pams
- )
- pts (mapcar '(lambda (x)
- (xdge::getpropertyvalue ge "evalPoint" x)
- )
- pams
- )
- )
- (mapcar '(lambda (x y)
- (grdraw x y 1)
- )
- pts
- (cdr pts)
- )
- )
- )
- )
- (if (setq e (xdrx_entsel "\nPick pline: " '((0 . "lwpolyline"))))
- (progn
- (setq ge (xdge::constructor (car e))
- gel (xdge::getpropertyvalue ge "getCurveList")
- )
- (while (setq p (getpoint "\nPick SegOn Pline: "))
- (setq int (fix (xdrx_curve_getparamatpoint (car e) p)))
- (if (not indexL)
- (progn
- (setq indexL (list int))
- (highlightseg ge gel int)
- )
- (if (not (member i indexL))
- (progn
- (highlightseg ge gel int)
- (setq indexL (cons int indexL))
- )
- )
- )
- )
- (princ "\n选择了 ")
- (princ (reverse indexL))
- (princ " 段")
- (if
- (/= (setq disL (getstring "\n输入各段偏移距离<以空格分隔>: " t))
- ""
- )
- (progn
- (setq distL (xdrx_string_split disL " ")
- cl (mapcar '(lambda (x) (nth x gel))
- indexL
- )
- plan (xdrx_getpropertyvalue (car e) "normal")
- )
- (mapcar '(lambda (x y / nCurve)
- (setq nCurve
- (xdge::getpropertyvalue
- x
- "getTrimmedOffset"
- (distof y)
- plan
- 1
- )
- )
- (xdge::entity:make nCUrve)
- (xdrx_entity_setpropertiesfrom (entlast) (car e))
- )
- cl
- distL
- )
- )
- )
- )
- )
- (princ)
- )
|