你好freinds
你好,朋友们即使是bylayer,我们如何获得实体颜色
我使用这个语法
(setq e (car(entsel"\select entity>... ")))
(setq objcolor (vla-get-Color (vlax-ename->vla-object e)))
如果实体bylayer的颜色值为256,无论颜色是什么 快速示例:
(defun entcolor ( enx )
(cond
((cdr (assoc 62 enx)))
((abs (cdr (assoc 62 (tblsearch "layer" (cdr (assoc 8 enx)))))))
)
)
使用DXF数据调用,例如:
(if (setq ent (car (entsel)))
(entcolor (entget ent))
) 李出了点问题
我在获取value entcolor时收到一条消息
#
我想要的是拾取多段线或直线,然后获取其颜色将颜色存储在变量中以供以后使用 您如何调用该函数?
您如何使用函数返回的值? (defun c:gcolr (/)
(defun objco ( enx )
(cond
((cdr (assoc 62 enx)))
((abs (cdr (assoc 62 (tblsearch "layer" (cdr (assoc 8 enx)))))))
)
)
(if (setq e (car (entsel"\n pick polyline,line")))
(objco (entget e))
)
)
颜色值存储在哪里
对于当前代码,不会存储颜色值,因为您没有使用“objco”函数返回的值。
考虑以下因素:
(defun c:gcolr ( / c e )
(if (setq e (car (entsel)))
(setq c (objco (entget e)))
)
(if c
(princ (strcat "\nThe colour of the selected object is: " (itoa c)))
(princ "\nThe user did not select an object.")
)
(princ)
)
(defun objco ( enx )
(cond
((cdr (assoc 62 enx)))
((abs (cdr (assoc 62 (tblsearch "layer" (cdr (assoc 8 enx)))))))
)
)
谢谢李,没关系 不客气。
页:
[1]