马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
 - (Defun C:Checkj()
- (Vl-Load-Com)
- (Setvar "Cmdecho" 0)
- (setq ptd '(-4890.5 828.38 00000.00))
- (setq cc 6)
- (Setq Sslabel (Ssget "X" '((0 . "Polyline"))))
- (Setq Ssn (Sslength Sslabel))
- (Setq M 0 L 0)
- (Repeat Ssn ;1求顶点坐标
- (Setq En (Ssname Sslabel M))
- (Setq Obj (Vlax-Ename->Vla-Object En))
- (Setq Vtx (Vla-Get-Coordinates Obj))
- (Setq Vtxlst (Vlax-Safearray->List (Vlax-Variant-Value Vtx)))
- (Setq Ll (/ (Length Vtxlst) 3))
- (Setq N 0 )
- (Repeat Ll ;11
- (Setq Pt (List (Nth N Vtxlst) (Nth (+ N 1) Vtxlst)))
- (setq ptla (strcat (Rtos (Nth 0 Pt)) (Rtos (Nth 1 Pt))))
- (Setq ssyuan (ssget "x" '((0 . "Circle"))))
- (setq ssyuanl (sslength ssyuan))
- (repeat ssyuanl;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;过滤圆
- (setq eny (ssname ssyuan l))
- (setq enydata (entget eny ))
- (setq yuan (cdr (assoc 10 enydata)))
- (setq ptyu (strcat (Rtos (Nth 0 yuan)) (Rtos (Nth 1 yuan))))
- (command "PLINE" pt ptd "")
- (setq pl (entlast))
- (If (= ptyu ptla)
- (COMMAND "CHPROP" PL "" C CC "") ;;;???不能变颜色???
- )
- (setq l (1+ l))
-
- );;;yuan
-
-
- (Setq N (+ N 3))
- );11
- (Setq M (1+ M))
- );;;;;;;;;;;;;;1
- (setq se (ssget "x" '((62 . cc )))) ;;;要删除改变颜色后的项
- (command "erase" se "");;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;这里有问题,不能执行命令,可能这两句的位置不合适
- (Princ "\n.命令:...The End...")
- (princ "\n.")
- ;(Prin1)
- )
|