Q:
Is there a lisp example that shows how to access Drawing Properties?
A:
Here is a Visual Lisp example that will update the Drawing Properties for the active drawing.
Note: Values which are changed in the user interface are not immediately reflected in the ActiveX properties. If the drawing is saved and then reopened, the values previously changed in the user interface are returned by the ActiveX properties. However, values which are set by the ActiveX methods are always immediately reflected in the user interface.
(defun c:dProps (/ dProps dProp)
(vl-load-com)
(setq acadObject (vlax-get-acad-object))
(setq acadDocument (vla-get-ActiveDocument acadObject))
;;Get the SummaryInfo
(setq dProps (vlax-get-Property acadDocument 'SummaryInfo))
;;Edit the SummaryInfo properties
(vlax-put-Property dProps 'Title "Test Title")
(vlax-put-Property dProps 'Subject "Test Subject")
(vlax-put-Property dProps 'Author "Test Author")
(vlax-put-Property dProps 'Keywords "One Two Three")
(vlax-put-Property dProps 'Comments "This is a comment")
(vlax-put-Property dProps 'HyperlinkBase "\\\\www.Autodesk.com")
(vlax-put-Property dProps 'LastSavedBy "Tester")
(vlax-put-Property dProps 'RevisionNumber "1")
;;Add an entry to the "Custom" tab
(vla-addcustominfo dProps "test custom" "custom value")
;;Access the updated properties and print them to the command window
(setq dProp (vlax-get-Property dProps 'Title))
(princ (strcat "Title = " dProp "\n"))
(setq dProp (vlax-get-Property dProps 'Subject))
(princ (strcat "Subject = " dProp "\n"))
(setq dProp (vlax-get-Property dProps 'Author))
(princ (strcat "Author = " dProp "\n"))
(setq dProp (vlax-get-Property dProps 'Keywords))
(princ (strcat "Keywords = " dProp "\n"))
(setq dProp (vlax-get-Property dProps 'Comments))
(princ (strcat "Comments = " dProp "\n"))
(setq dProp (vlax-get-Property dProps 'HyperlinkBase))
(princ (strcat "HyperlinkBase = " dProp "\n"))
(setq dProp (vlax-get-Property dProps 'LastSavedBy))
(princ (strcat "LastSavedBy = " dProp "\n"))
(setq dProp (vlax-get-Property dProps 'RevisionNumber))
(princ (strcat "RevisionNumber = " dProp "\n"))
(princ)
)