大家好,
祝大家圣诞快乐,新年快乐。
只是一个简单的问题,我相信几分钟内就能回答。
当看到最近在这里发布的一个问题(关于在高尔夫球场上标记点…)时,我在考虑如何解决这个问题,并考虑使用用户绘制的多段线的顶点。
为了进行实验,我给自己画了一条多段线(附加),并对其执行entget操作,以查看它将返回什么。
结果如下:
- ((-1 . <Entity name: 7ef62ed8>)
- [color=Purple][b](0 . "LWPOLYLINE") <<--- Entity Type[/b][/color]
- (330 . <Entity name: 7ef53cc0>)
- (5 . "2DC3")
- (100 . "AcDbEntity")
- (67 . 0)
- [b][color=Orange](410 . "Model") [/color][color=Orange]<<--- Tab Name[/color][/b]
- [b][color=YellowGreen](8 . "3") [/color][color=YellowGreen]<<--- Layer Name[/color][/b]
- (100 . "AcDbPolyline")
- (90 . 4)
- (70 . 0)
- (43 . 0.0)
- (38 . 0.0)
- (39 . 0.0) [color=Red][b]
- (10 0.0 0.0)[/b][/color] [b][color=Red]<<--- First Vertex (Start Point)[/color][/b]
- [b][color=RoyalBlue](40 . 0.0) [/color][color=RoyalBlue]<<--- Starting Thickness for First Segment[/color][/b]
- [b][color=SeaGreen](41 . 0.0) [/color][color=SeaGreen]<<--- Ending Thickness for First Segment[/color][/b]
- (42 . 0.0)
- [b][color=Red](10 10.0 0.0)[/color][/b] [b][color=Red]<<--- Second Vertex[/color][/b]
- [b][color=RoyalBlue](40 . 0.0)[/color]
- [color=SeaGreen](41 . 0.0)[/color][/b]
- (42 . 0.0)
- [b][color=Red](10 10.0 10.0)[/color][/b] [b][color=Red]<<--- Third Vertex[/color][/b]
- [b][color=RoyalBlue](40 . 0.0)[/color]
- [color=SeaGreen](41 . 0.0)[/color][/b]
- (42 . 0.0)
- [b][color=Red](10 0.0 10.0)[/color][/b] [b][color=Red]<<--- Fourth Vertex (End Point)[/color][/b]
- [b][color=RoyalBlue](40 . 0.0)[/color]
- [color=SeaGreen](41 . 0.0)[/color][/b]
- (42 . 0.0)
- (210 0.0 0.0 1.0))
删除所有非10组:
- (defun c:test (/ ent Vertex)
- (setq ent (entget (car (entsel))))
- (setq Vertex (cdr (assoc [b][color=Red]10[/color][/b] ent)))
- (princ)
- ) ;_ end defun
删除每个列表的第一个成员“
- Command: (setq plDxf(entget(car(entsel))))
- Select object: ((-1 . <Entity name: 7efa3368>) (0 . "LWPOLYLINE") (330 .
- <Entity name: 7efa1cf8>) (5 . "1AD") (100 . "AcDbEntity") (67 . 0) (410 .
- "Model") (8 . "0") (100 . "AcDbPolyline") (90 . 4) (70 . 0) (43 . 0.0) (38 .
- 0.0) (39 . 0.0) (10 0.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 10.0 0.0) (40
- . 0.0) (41 . 0.0) (42 . 0.0) (10 10.0 10.0) (40 . 0.0) (41 . 0.0) (42 . 0.0)
- (10 0.0 10.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (210 0.0 0.0 1.0))
或者立即:
- Command: (setq lst10(vl-remove-if '(lambda(x)(/= 10(car x)))plDxf))
- ((10 0.0 0.0) (10 10.0 0.0) (10 10.0 10.0) (10 0.0 10.0))
|