Message 1 of 7

Not applicable
02-22-2020
01:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I tried to find a solution with some forum posts, but it doesn't work. I'm looking for a Lisp code which allows me to insert content in the command line to change some dwgprops values. I hope to be clear enough :S
(defun ChgDwgprops ( .... ?? )))
(ChgDwgprops '( (vla-addcustominfo dwgprops "TAG_10" "123")))))
For example: It works very well for me to change some attribute values - Thx alot Danny NL
Updating block attribute via command line - Thx Danny NL
(defun UpdateAttributes (UA_UpdateList / UA_Selection UA_Block UA_ProcessList UA_NewValue) (if (setq UA_Selection (ssget "_X" '((0 . "INSERT")(66 . 1)))) (progn (vla-StartUndoMark (vla-get-ActiveDocument (vlax-get-acad-object))) (foreach UA_Entity (mapcar 'cadr (ssnamex UA_Selection)) (if (setq UA_ProcessList (assoc (strcase (vla-get-EffectiveName (setq UA_Block (vlax-ename->vla-object UA_Entity)))) UA_UpdateList)) (foreach UA_Attribute (vlax-safearray->list (vlax-variant-value (vla-GetAttributes UA_Block))) (if (setq UA_NewValue (cadr (assoc (strcase (vla-get-TagString UA_Attribute)) (cadr UA_ProcessList)))) (vla-put-TextString UA_Attribute UA_NewValue) ) ) ) ) (vla-EndUndoMark (vla-get-ActiveDocument (vlax-get-acad-object))) ) ) )
(UpdateAttributes '( ("BLOCKNAME_1" (("TAG_1" "123")("TAG_2" "xyz"))) ("BLOCKNAME_2" (("TAG_1" "---"))) ("BLOCKNAME_3" (("TAG_1" "xXx")("TAG_2" "ABC"))) ) )
Solved! Go to Solution.