- (defun C:addprops1 (/ App Doc DwgProps lanme dname pname)
- (setq App (vlax-Get-Acad-Object)
- Doc (vla-Get-ActiveDocument App)
- DwgProps (vla-Get-SummaryInfo Doc)
- )
-
- (setq Num (vla-NumCustomInfo DwgProps))
-
- (setq lname (getvar "loginname"))
- (IF (= lname "andrew")
- (setq lname "AM")
- )
- (setq dname (vl-filename-base (getvar "dwgname")))
- (setq pname (vl-Filename-Base
- (vl-Filename-Directory (getvar "Dwgprefix"))
- )
- )
- (vla-put-author dwgprops lname)
- (if (vl-catch-all-apply
- 'vla-removecustombykey
- (list dwgprops "")
- )
- ;(vla-addcustominfo dwgprops "" "84")
- (progn
- (vl-catch-all-apply
- 'vla-removecustombykey
- (list dwgprops "Job No.")
- )
- (vla-addcustominfo dwgprops "Job No." "123")
- )
- )
- (if (vl-catch-all-apply
- 'vla-removecustombykey
- (list dwgprops "Job No.")
- )
- (vla-addcustominfo dwgprops "Job No." "123")
- (progn
- (vl-catch-all-apply
- 'vla-removecustombykey
- (list dwgprops "Job No.")
- )
- (vla-addcustominfo dwgprops "Job No." "123")
- )
- )
- (if (vl-catch-all-apply
- 'vla-removecustombykey
- (list dwgprops "DWG Name")
- )
- (vla-addcustominfo dwgprops "DWG Name" "abc")
- (progn
- (vl-catch-all-apply
- 'vla-removecustombykey
- (list dwgprops "DWG Name")
- )
- (vla-addcustominfo dwgprops "DWG Name" "abc")
- )
- )
- ;(vla-AddCustomInfo DwgProps "Sample3" "Data3")
- ;(vla-SetCustomByIndex DwgProps 0 "Sample1" "data1")
- ;(vla-SetCustomByIndex DwgProps 1 "Sample2" "data2")
- ;(vla-SetCustomByIndex DwgProps 2 "Sample3" "data3")
-
- (setq xx (vla-GetCustomByIndex DwgProps 1 'id 'value))
- ;(vla-GetCustomByIndex DwgProps 1 'cc 'dd)
- ;(vla-GetCustomByIndex DwgProps 2 'ee 'ff)
-
- (vla-put-comments
- dwgprops
- (strcat "New comments1\r\n" "comments2")
- )
- ;(vla-put-comments dwgprops "New comments2")
- (vla-put-keywords dwgprops "New keywords")
- (vla-put-subject dwgprops "Subject")
- (vla-put-Title dwgprops "Title")
|