Search the Community
Showing results for tags 'dwgprops'.
-
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?
-
insert custom properties from DWGPROPS in lisp as variabel
Manuel_Kunde posted a topic in AutoLISP, Visual LISP & DCL
Hi all, is it possible to read attributes or properties from the _DWGPROPS and list them in a Lisp e.g. as variables? I need the yellow marked attribute (OD2485), which always has a different number. (defun c:dropsforatts () (setq (vla-get-ActiveDocument (vlax-get-acad-object)) (vla-get-SummaryInfo doc) ) (setq i 0) (setq i 5) ) I would then like to insert this variable into a file path in a Lisp. (defun c:tempsave () (getvar "DWGNAME") (getvar "DWGPREFIX") (command "_+saveas" "G" "2018dwg" "2018(LT2018)" ("F:\\\\Clients\\CT2485\\OD2485\\Planning" ;i need the OD2485 as a variabel from the DWGPROPS (strcat (substr (getvar "DWGNAME") 1 8) "_temp") ) ) ) -
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.
-
Time to appear in Drawing Utilities
Conor posted a topic in The CUI, Hatches, Linetypes, Scripts & Macros
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? -
Hi All, who knows whether it is possible to change drawing properties without opening it using ObjectDBX or not? If so how to save the new properties to the drawing file? I greatly appreciate any help.
- 15 replies