从嵌套匹配属性项. .它是可能的
大家好在某些情况下,我们需要将选定对象的属性更改为嵌套对象的属性
例如,要将所选线条的线型和颜色更改为与外部参照中的线条相同。
在这种情况下,我按照以下方式执行:
1.将外部参照的线条复制到当前图形
2.将“ncopied”线条匹配到线条,我需要更改
3.删除“nCopiled”线条
是否可以通过lisp“自动化”此过程
我做了一些“肮脏”的方法,但都不管用
有人能帮我解决这个问题吗
任何帮助都将非常感谢
**** Hidden Message ***** 我假设您必须确保要复制的嵌套属性对于非嵌套实体有效。在您的示例中,需要将线型重命名为当前图形中的线型
目前windows计算机上没有,因此该示例可能不完全正确
嵌套线型:
|
因此,将“|”符号后面的项目(不包括)作为新属性使用。 .. 这并不像它看起来那么简单T.Willey
y 类型没有任何测试(和我很久 可能是这样:
(defun c:mpn (/ e p s p p2)
(if (and (setq e (car (nentsel "\nPick an item to match property: "))) (setq s (ssget ":L")))
(progn (foreach prop '(6 62)
(if (or (setq p (assoc prop (entget e)))
(setq p (assoc prop (entget (tblobjname "layer" (cdr (assoc 8 (entget e)))))))
)
(setq p2 (cons p p2))
)
)
(foreach item (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
(foreach prop p2 (entmod (append (entget item) (list prop))))
)
)
)
(princ)
) …非常有趣的解决方案ronjonp,谢谢,但不幸的是,该功能尚未完成。
根据嵌套项的颜色仅更改线条的颜色,但线型、图层名称和其他属性尚未更改 它应该像你要求的那样做线型和颜色。如果你不按对象做属性,你要做的就是把新的项目放在同一个层上。 它应该做的,但不幸的是不
我checke 完美的解决方案来自这里:
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/match-properties-from-nested-item-is-it-possible/td-p/6915286
谢谢
比基茨大师。 试试这个:
(defun c:a ()
(setq es (entsel "\n Select Object inside Block : "))
(setq s (car es))
(setq po (cadr es))
(setq en (entget s))
(setq typ (strcase (cdr (assoc 0 en)) t))
(cond
((= typ "insert")
(command "ncopy" po "" "none" '(0 0 0) "none" '(0 0 0))
(setq s1 (entlast))
(defun *error* (msg) (entdel s1) (princ))
;;(command "matchprop" (nentselp po))
(command "matchprop" s1)
(while (> (getvar 'cmdactive) 0) (command "box" pause pause))
(entdel s)
)
)
(princ)
)
页:
[1]
2