Search the Community
Showing results for tags 'dwgprops'.
Found 4 results
Folks, I know I am doing something critically wrong here but don't know how to fix it. What I need to do is to read an attribute from a specific title block and write its value to DWGPROPS. Following code will read the attribute for me: (defun Display_Tag_Value (blkname TAG_NAME) (vl-load-com) (ssget "x" (list '(0 . "INSERT") (cons 2 blkname) '(66 . 1)) ) (vlax-for item (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)) ) (foreach ATTRIBUTE_NAME (vlax-safearray->list (vlax-variant-value (vla-getattributes item)) ) (if (= TAG_NAME (vla-get-tagstring ATTRIBUTE_NAME)) (setq str (vla-get-TextString ATTRIBUTE_NAME)) ) ) ) (PRINC str) (PRINC) ) So till now I can read "ATTRIBUTE NAME" value of "BLOCKNAME" with this line: (Display_Tag_Value "[color="red"]BLOCKNAME[/color]" "[color="red"]ATTRIBUTE NAME[/color]") Also this code, can push values to drawing properties: (defun dProps (/ dProp) (vl-load-com) (setq acadObject (vlax-get-acad-object)) (setq acadDocument (vla-get-ActiveDocument acadObject)) (setq dProp (vlax-get-Property acadDocument 'SummaryInfo)) (vlax-put-Property dProp 'Title [color="green"]"test title"[/color]) (princ) ) Hence, I was hoping to reach my goal by mixing these two together: (defun dProps (/ dProp) (vl-load-com) (setq acadObject (vlax-get-acad-object)) (setq acadDocument (vla-get-ActiveDocument acadObject)) (setq dProp (vlax-get-Property acadDocument 'SummaryInfo)) (vlax-put-Property dProp 'Title [color="red"](Display_Tag_Value "BLOCKNAME" "ATTRIBUTE NAME")[/color] ) (princ) ) But ... here is the error I get: error: lisp value has no coercion to VARIANT with this type: In brief: how can I pass a returned value of my function to 'vlax-put-Property'? P.S: Read Lee's code here, but had no idea how to use it.
Hi, I hope you can help. I have created buttons which create custom properties in the DWGPROPS. I would now like to add another custom properties which shows the Current Time (not to be updated). Can this be done?
I work as an engineer for a solar company. We preform all of our calculations on an excel file, then transfer these values to Autocad to show our calculations for the plan checkers. I use the DWGPROPS command in Autocad to auto populate all the pages in my plans. I tend to do a lot of copy and pasting and to do all this. Is there a way to isolate the excel values I need and import them into my Autocad DWGPROPS?