马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 st788796 于 2014-11-1 07:55 编辑
 - (defun c:tt (/ ss gel gcc ge1 ge2 nl normal tf gel1)
- (if (setq ss (ssget '((0 . "hatch"))))
- (progn
- (mapcar
- '(lambda (x / n i lst)
- (setq n (xdrx_getpropertyvalue x "numLoops") ;_环数
- i -1
- )
- (repeat n
- (setq lst (xdrx_getpropertyvalue
- x
- "getLoopAt"
- (setq i (1+ i)) ;_依次取出所有环
- )
- )
- (if (= (logand (car lst) 2) 2) ;_mod 2 Polyline
- (mapcar
- '(lambda (a)
- (setq gel (cons a gel))
- )
- (xdge::getpropertyvalue (caadr lst) "getCurveList")
- ) ;_ CompositeCurve 时再取出 CurveList
- (mapcar '(lambda (a)
- (setq gel (cons a gel))
- )
- (cdr lst)
- ) ;_其他直接进表
- )
- )
- )
- (xdrx_pickset->ents ss)
- )
- (setq gcc (xdge::constructor "kCurveCurveInt2d")) ;_这里是 2d
- (while gel
- (setq ge1 (car gel)
- gel1 (cdr gel)
- tf t
- )
- (while (and tf gel1)
- (setq ge2 (car gel1))
- (xdge::setpropertyvalue gcc "set" ge1 ge2) ;_2d 就不需要 normal 了
- (if (> (xdge::getpropertyvalue gcc "overLapCount") 0) ;_查找有重叠的线
- (setq tf nil
- nl (cons ge1 nl)
- )
- )
- (setq gel1 (cdr gel1))
- )
- (setq gel (cdr gel))
- )
- (if nl
- (progn
- (setq
- pl (mapcar
- '(lambda (x) (xdge::constructor "kCompositeCrv2d" x))
- nl
- )
- ss (xdge::entity:make pl)
- ) ;_生成重叠线,即分隔线
- (xdrx_entity_setcolor ss 2)
- (mapcar '(lambda (x)
- (xdrx_polyline_setConstantWidth x 40.)
- )
- (xdrx_pickset->ents ss)
- )
- )
- )
- (xdge::free)
- )
- )
- (princ)
- )
|