Drawing Properties (DWGPROPS) (Windows)

Discussion in 'AutoCAD' started by ManfredW, Jul 23, 2003.

  1. ManfredW

    ManfredW Guest

    Drawing Properties (DWGPROPS) (Windows)
    ----------------------------------------------
    How to write Drawing Properties (DWGPROPS) so that it wil show up in Windows (properties, summary)??????
    I,ve created a proggy (see below) to write the properties, but then Windows (properties) has an extra tab with the info
    So how ???
    ______________________________________________________
    this command (getfield "teile_unit") is for retrieving info from a database ______________________________________________________
    ; Setting DWG properties
    ;
    (defun Set_DWGPROPS (List_of_Props_to_change / SDP_DWGPROPS Number_of_UserProps new_xRecord
    SDP_new_Property Without_List Name_xRecord
    SDP_new_List Props_Counter
    SDP_old_Property comp_Props)
       (if (and (setq SDP_DWGPROPS (dictsearch (namedobjdict) "DWGPROPS"))
        (listp List_of_Props_to_change)) (progn
           (setq Props_Counter 0)
           (while (< Props_Counter (length List_of_Props_to_change))
    (setq SDP_new_Property (nth Props_Counter List_of_Props_to_change)
    SDP_old_Property (assoc (car SDP_new_Property) SDP_DWGPROPS)
    SDP_new_List (subst SDP_new_Property SDP_old_Property SDP_DWGPROPS)
    SDP_DWGPROPS SDP_new_List
    Props_Counter (+ Props_Counter 1)))
           (setq Props_Counter 0 Number_of_UserProps 0)
           (while (< Props_Counter 10)
    (if (/= (cdr (assoc (+ 300 Props_Counter) SDP_new_List)) "=") (setq Number_of_UserProps (+ Number_of_UserProps 1)))
    (setq Props_Counter (+ Props_Counter 1)))
           (setq SDP_new_List (subst (cons 90 Number_of_UserProps) (assoc 90 SDP_new_List) SDP_new_List)
            Without_List (list -1 5 102 330) Props_Counter 0 new_Xrecord (list))
           (while (< Props_Counter (length SDP_new_List))
    (setq comp_Props (nth Props_Counter SDP_new_List))
    (if (not (member (car comp_Props) Without_List))
    (setq new_xRecord (append new_xRecord (list Comp_Props))))
    (setq Props_Counter (+ Props_Counter 1)))
           (entdel (cdr (car SDP_new_List)))
           (setq Name_xRecord (entmakex new_xRecord))
           (dictadd (namedobjdict) "DWGPROPS" Name_xRecord))))

    ;MW -----------------------------------------------------
    (defun C:DWGprop ()
    (prompt "\n\nWriting DWGproperties ... ")
    ;--------------------------------------------------------
    ;USERDEF

    (setq Zeichnung (spacecut (getfield "Zeichnung")))
    (if (= Zeichnung nil)
        (setq Zeichnung "")
    )
    (setq TagNr (spacecut (getfield "tag_nr")))
    (if (= TagNr nil)
        (setq TagNr "")
    )
    (setq Schrank (spacecut (getfield "Schrank")))
    (if (= Schrank nil)
        (setq TagNr "")
    )
    (setq Titel1 (spacecut (getfield "titel_1")))
    (setq Titel2 (spacecut (getfield "titel_2")))
    (setq Titel3 (spacecut (getfield "titel_3")))
    (if (or (= Titel3 "NIL") (= Titel3 nil))
        (setq Titel3 "")
    )
    (setq Anlage (spacecut (getfield "Anlage" )))
    (setq BE (spacecut (getfield "teile_unit" )))
    (if (= BE nil)
        (setq BE "")
    )
    (setq Typ (spacecut (getfield "Typ" )))
    (if (= Typ nil)
        (setq Typ "")
    )
    (setq Gruppe (spacecut (getfield "Gruppe" )))
    (if (= Gruppe nil)
        (setq Gruppe "")
    )
    (setq RevisionIndx (spacecut (getfield "Rev_B_Neu" )))
    (setq RevisionText (spacecut (getfield "Rev_T_Neu" )))
    (setq RevisionDate (spacecut (getfield "Rev_D_Neu" )))
    (setq RevisionName (spacecut (getfield "Rev_N_Neu" )))
    (if (= RevisionIndx nil)
        (setq RevisionIndx "")
    )
    (if (= RevisionText "NIL")
        (setq RevisionText "")
    )
    (if (= RevisionDate "NIL")
        (setq RevisionDate "")
    )
    (if (= RevisionName "NIL")
        (setq RevisionName "")
    )

    (set_dwgprops (list
         (cons 300 (strcat "Zeichnung=" Zeichnung))
         (cons 301 (strcat "Titel1=" Titel1))
         (cons 302 (strcat "Titel2=" Titel2))
         (cons 303 (strcat "Titel3=" Titel3))
         (cons 304 (strcat "Anlage=" Anlage))
         (cons 305 (strcat "BE=" BE))
         (cons 306 (strcat "Typ=" Typ))
         (cons 307 (strcat "Gruppe=" Gruppe))
         (cons 308 (strcat "TagNr/Schrank=" TagNr))
         (cons 309 (strcat "Revision=" RevisionIndx " | " RevisionText " | " RevisionDate " | " RevisionName))
         ))
    ;--------------------------------------------------------

    ;--------------------------------------------------------
    ;DEFAULT

    (setq Keywords (strcat Zeichnung " " TagNr " " Anlage " " " " BE " " Typ " " Gruppe))
    (set_dwgprops (list
         (cons 7 Keywords)
         ))

    (setq Comments (strcat
    Zeichnung (chr 13)(chr 10)
    Titel1 (chr 13)(chr 10)
    Titel2 (chr 13)(chr 10)
    Titel3 (chr 13)(chr 10)
    Anlage (chr 13)(chr 10)
    BE (chr 13)(chr 10)
    Typ (chr 13)(chr 10)
    Gruppe (chr 13)(chr 10)
    TagNr (chr 13)(chr 10)
    RevisionIndx " | " RevisionText " | " RevisionDate " | " RevisionName
    ))

    (set_dwgprops (list
         (cons 6 Comments)
         ))

    ;--------------------------------------------------------
    (prompt "done")
    (princ)
    ;(command "DWGPROPS")
    )
     
    ManfredW, Jul 23, 2003
    #1
  2. ManfredW

    The real JD Guest

    I also noticed this. I was hoping that using the properties tab in Windows 2000 would be the same as dwg props tab in AutoCAD. Unfortunately it isn't. I'm not that great with lisp. What variables are you inputting into the dwgprops dialog? What kind of database are you taking it from? can it be modified to retrieve attribute values from a titleblock?



     



    "ManfredW" <> wrote in message news:...

    Drawing Properties (DWGPROPS) (Windows)
    ----------------------------------------------
    How to write Drawing Properties (DWGPROPS) so that it wil show up in Windows (properties, summary)??????
    I,ve created a proggy (see below) to write the properties, but then Windows (properties) has an extra tab with the info
    So how ???
    ______________________________________________________
    this command (getfield "teile_unit") is for retrieving info from a database ______________________________________________________
    ; Setting DWG properties
    ;
    (defun Set_DWGPROPS (List_of_Props_to_change / SDP_DWGPROPS Number_of_UserProps new_xRecord
    SDP_new_Property Without_List Name_xRecord
    SDP_new_List Props_Counter
    SDP_old_Property comp_Props)
       (if (and (setq SDP_DWGPROPS (dictsearch (namedobjdict) "DWGPROPS"))
        (listp List_of_Props_to_change)) (progn
           (setq Props_Counter 0)
           (while (< Props_Counter (length List_of_Props_to_change))
    (setq SDP_new_Property (nth Props_Counter List_of_Props_to_change)
    SDP_old_Property (assoc (car SDP_new_Property) SDP_DWGPROPS)
    SDP_new_List (subst SDP_new_Property SDP_old_Property SDP_DWGPROPS)
    SDP_DWGPROPS SDP_new_List
    Props_Counter (+ Props_Counter 1)))
           (setq Props_Counter 0 Number_of_UserProps 0)
           (while (< Props_Counter 10)
    (if (/= (cdr (assoc (+ 300 Props_Counter) SDP_new_List)) "=") (setq Number_of_UserProps (+ Number_of_UserProps 1)))
    (setq Props_Counter (+ Props_Counter 1)))
           (setq SDP_new_List (subst (cons 90 Number_of_UserProps) (assoc 90 SDP_new_List) SDP_new_List)
            Without_List (list -1 5 102 330) Props_Counter 0 new_Xrecord (list))
           (while (< Props_Counter (length SDP_new_List))
    (setq comp_Props (nth Props_Counter SDP_new_List))
    (if (not (member (car comp_Props) Without_List))
    (setq new_xRecord (append new_xRecord (list Comp_Props))))
    (setq Props_Counter (+ Props_Counter 1)))
           (entdel (cdr (car SDP_new_List)))
           (setq Name_xRecord (entmakex new_xRecord))
           (dictadd (namedobjdict) "DWGPROPS" Name_xRecord))))

    ;MW -----------------------------------------------------
    (defun C:DWGprop ()
    (prompt "\n\nWriting DWGproperties ... ")
    ;--------------------------------------------------------
    ;USERDEF

    (setq Zeichnung (spacecut (getfield "Zeichnung")))
    (if (= Zeichnung nil)
        (setq Zeichnung "")
    )
    (setq TagNr (spacecut (getfield "tag_nr")))
    (if (= TagNr nil)
        (setq TagNr "")
    )
    (setq Schrank (spacecut (getfield "Schrank")))
    (if (= Schrank nil)
        (setq TagNr "")
    )
    (setq Titel1 (spacecut (getfield "titel_1")))
    (setq Titel2 (spacecut (getfield "titel_2")))
    (setq Titel3 (spacecut (getfield "titel_3")))
    (if (or (= Titel3 "NIL") (= Titel3 nil))
        (setq Titel3 "")
    )
    (setq Anlage (spacecut (getfield "Anlage" )))
    (setq BE (spacecut (getfield "teile_unit" )))
    (if (= BE nil)
        (setq BE "")
    )
    (setq Typ (spacecut (getfield "Typ" )))
    (if (= Typ nil)
        (setq Typ "")
    )
    (setq Gruppe (spacecut (getfield "Gruppe" )))
    (if (= Gruppe nil)
        (setq Gruppe "")
    )
    (setq RevisionIndx (spacecut (getfield "Rev_B_Neu" )))
    (setq RevisionText (spacecut (getfield "Rev_T_Neu" )))
    (setq RevisionDate (spacecut (getfield "Rev_D_Neu" )))
    (setq RevisionName (spacecut (getfield "Rev_N_Neu" )))
    (if (= RevisionIndx nil)
        (setq RevisionIndx "")
    )
    (if (= RevisionText "NIL")
        (setq RevisionText "")
    )
    (if (= RevisionDate "NIL")
        (setq RevisionDate "")
    )
    (if (= RevisionName "NIL")
        (setq RevisionName "")
    )

    (set_dwgprops (list
         (cons 300 (strcat "Zeichnung=" Zeichnung))
         (cons 301 (strcat "Titel1=" Titel1))
         (cons 302 (strcat "Titel2=" Titel2))
         (cons 303 (strcat "Titel3=" Titel3))
         (cons 304 (strcat "Anlage=" Anlage))
         (cons 305 (strcat "BE=" BE))
         (cons 306 (strcat "Typ=" Typ))
         (cons 307 (strcat "Gruppe=" Gruppe))
         (cons 308 (strcat "TagNr/Schrank=" TagNr))
         (cons 309 (strcat "Revision=" RevisionIndx " | " RevisionText " | " RevisionDate " | " RevisionName))
         ))
    ;--------------------------------------------------------

    ;--------------------------------------------------------
    ;DEFAULT

    (setq Keywords (strcat Zeichnung " " TagNr " " Anlage " " " " BE " " Typ " " Gruppe))
    (set_dwgprops (list
         (cons 7 Keywords)
         ))

    (setq Comments (strcat
    Zeichnung (chr 13)(chr 10)
    Titel1 (chr 13)(chr 10)
    Titel2 (chr 13)(chr 10)
    Titel3 (chr 13)(chr 10)
    Anlage (chr 13)(chr 10)
    BE (chr 13)(chr 10)
    Typ (chr 13)(chr 10)
    Gruppe (chr 13)(chr 10)
    TagNr (chr 13)(chr 10)
    RevisionIndx " | " RevisionText " | " RevisionDate " | " RevisionName
    ))

    (set_dwgprops (list
         (cons 6 Comments)
         ))

    ;--------------------------------------------------------
    (prompt "done")
    (princ)
    ;(command "DWGPROPS")
    )
     
    The real JD, Jul 28, 2003
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.