honey 发表于 2022-7-6 12:18:13

识别对象

尊敬的先生:
 
我正在编写一个lisp,如果选定的对象是lwpolyline,我想在其中圆角。
但我无法推导出,所选实体是否为lwpolyline。有人能帮我吗。
 
提前谢谢你。

gile 发表于 2022-7-6 13:08:46

你好
 
使用entget函数获取实体的DXF列表,并查找0代码组值:
 
(setq ent (car (entsel)))
(if (= "LWPOLYLINE" (cdr (assoc 0 (entget ent))))
(alert "You selected a polyline")
(alert "You didn't select a polyline)
)

honey 发表于 2022-7-6 13:25:02

非常感谢Gile
页: [1]
查看完整版本: 识别对象