Author Topic: dwgprops !?  (Read 4134 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
dwgprops !?
« on: October 13, 2005, 01:27:55 PM »
Hi all,

How can I get DWGPROPS in lisp ?
Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: dwgprops !?
« Reply #1 on: October 13, 2005, 01:32:56 PM »
Use the SummaryInfo object.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: dwgprops !?
« Reply #2 on: October 13, 2005, 01:35:33 PM »
Use the SummaryInfo object.

heu ?
Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: dwgprops !?
« Reply #3 on: October 13, 2005, 01:40:43 PM »
huh?

Code: [Select]
(vlax-dump-object
    (vla-get-summaryinfo
        (vla-get-activedocument
            (vlax-get-acad-object)
        )
    )
    t
)

Spewage:

Quote
; 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)

Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: dwgprops !?
« Reply #4 on: October 13, 2005, 02:02:44 PM »
Thanks MP...
but i'm not very familer to VLAX..
I need to keep the item 2...
Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: dwgprops !?
« Reply #5 on: October 13, 2005, 03:33:54 PM »
This will retrieve all the custom info per the original order --

Code: [Select]
(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:

Quote
(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.
« Last Edit: October 13, 2005, 04:24:54 PM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: dwgprops !?
« Reply #6 on: October 13, 2005, 03:53:15 PM »
MP ...

you a genious !

I have to learn more about VLAX..

thanks.
Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: dwgprops !?
« Reply #7 on: October 13, 2005, 04:05:23 PM »
I wish. Thank you Andrea.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: dwgprops !?
« Reply #8 on: October 14, 2005, 10:42:03 AM »
a little more question..

I do I change a value ? or add one ?
Keep smile...

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: dwgprops !?
« Reply #9 on: October 14, 2005, 12:07:32 PM »

I do I change a value ? or add one ?

Found this in my "junk" file.
Code: [Select]
;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)
    )
  )
TheSwamp.org  (serving the CAD community since 2003)