TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on October 13, 2005, 01:27:55 PM
-
Hi all,
How can I get DWGPROPS in lisp ?
-
Use the SummaryInfo object.
-
Use the SummaryInfo object.
heu ?
-
huh?
(vlax-dump-object
(vla-get-summaryinfo
(vla-get-activedocument
(vlax-get-acad-object)
)
)
t
)
Spewage:
; IAcadSummaryInfo: IAcadSummaryInfo Interface
; Property values:
; Author = ""
; Comments = ""
; HyperlinkBase = ""
; Keywords = ""
; LastSavedBy = ""
; RevisionNumber = ""
; Subject = ""
; Title = ""
; Methods supported:
; AddCustomInfo (2)
; GetCustomByIndex (3)
; GetCustomByKey (2)
; NumCustomInfo ()
; RemoveCustomByIndex (1)
; RemoveCustomByKey (1)
; SetCustomByIndex (3)
; SetCustomByKey (2)
-
Thanks MP...
but i'm not very familer to VLAX..
I need to keep the item 2...
-
This will retrieve all the custom info per the original order --
(defun foo ( )
( (lambda ( summaryinfo / i result name value )
(repeat (setq i (vla-numcustominfo summaryinfo))
(setq result
(cons
(progn
(vla-getcustombyindex
summaryinfo
(setq i (1- i))
'name
'value
)
(cons name value)
)
result
)
)
)
)
(vla-get-summaryinfo
(vla-get-activedocument
(vlax-get-acad-object)
)
)
)
)
Example:
(foo)
(
("myname1" . "myvalue1")
("myname2" . "myvalue2")
("myname3" . "myvalue3")
)
Note that due to Autodesk's poor implementation of this if you place information in said object, you will not be able to read it back until the drawing is saved, closed and re-opened. Thank Autodesk.
-
MP ...
you a genious !
I have to learn more about VLAX..
thanks.
-
I wish. Thank you Andrea.
-
a little more question..
I do I change a value ? or add one ?
-
I do I change a value ? or add one ?
Found this in my "junk" file.
;Document.SummaryInfo
(defun get-suminfo-obj ()
(vla-get-SummaryInfo
(vla-get-ActiveDocument
(vlax-get-acad-object)
)
)
)
(defun login-as-author ()
(vlax-put-property
(get-suminfo-obj)
'Author
(getvar 'loginname)
)
)