custom properties

custom properties

Anonymous
Not applicable
427 Views
4 Replies
Message 1 of 5

custom properties

Anonymous
Not applicable
Does anybody know how to use VBA to acces the custom properties in AutoCAD
(dwgprops command in AutoCAD)? I know you can determine if a file is
read-only, archive, etc. through VBA, but I'd like to be able to determine
the values of some custom properties that I've set up without opening a
.dwg.
0 Likes
428 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
ThisDrawing.GetVariable for properties, I don't know about getting them
without opening. Is this possible with plain autocad?

"Dudemeister" wrote in message
news:5A79A19B15B942B206D39EE6AE3354E0@in.WebX.maYIadrTaRb...
Does anybody know how to use VBA to acces the custom properties in AutoCAD
(dwgprops command in AutoCAD)? I know you can determine if a file is
read-only, archive, etc. through VBA, but I'd like to be able to determine
the values of some custom properties that I've set up without opening a
.dwg.
0 Likes
Message 3 of 5

Anonymous
Not applicable
Try controls used to view/edit acad custom properties without opening it.
The file is acadXprops.zip from WWW.AcadX.Com

Fred
"Dudemeister" wrote in message
news:5A79A19B15B942B206D39EE6AE3354E0@in.WebX.maYIadrTaRb...
> Does anybody know how to use VBA to acces the custom properties in AutoCAD
> (dwgprops command in AutoCAD)? I know you can determine if a file is
> read-only, archive, etc. through VBA, but I'd like to be able to determine
> the values of some custom properties that I've set up without opening a
> .dwg.
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
Hi!
The information you want is stored in the Drawings Dictionary collection as
an XRecord named "DWGPROPS"
But only if the DWGPROPS command has been used at least once in the drawing.

Assuming that it has, you can use code like this to get at that data from
VBA:

Public Sub PrintDWGPROPS()
Dim objRecord As AcadXRecord
Dim objCol As AcadDictionaries
Dim varType As Variant
Dim varData As Variant
Dim intCnt As Integer
On Error GoTo Err_Control
Set objCol = ThisDrawing.Dictionaries
Set objRecord = objCol.Item("DWGPROPS")
objRecord.GetXRecordData varType, varData
For intCnt = LBound(varType) To UBound(varType)
Debug.Print varData(intCnt)
Next intCnt
Exit_Here:
Exit Sub
Err_Control:
Debug.Print Err.Description
Resume Exit_Here
End Sub

And if it does not exist, well, AutoDesk product support offered this..
Please note, I don't support this link.
I don't even like looking at the code this page contains.
*grits teeth and posts anyway

http://discussion.autodesk.com/WebX?233@@.ef00c8e/6!enclos
ure=.ef04db8

Now, if that comes back with a page not found its because the URL did a
wrap, it should all be one big line..

Randall Rath
0 Likes
Message 5 of 5

Anonymous
Not applicable
You can use acaddpx.dll to access the drawing properties from other programs
like Excell.

--
Kent

"Kevin Terry" wrote in message
news:F563A23DE911D2FB3A9AEA937DC010DE@in.WebX.maYIadrTaRb...
> ThisDrawing.GetVariable for properties, I don't know about getting them
> without opening. Is this possible with plain autocad?
>
> "Dudemeister" wrote in message
> news:5A79A19B15B942B206D39EE6AE3354E0@in.WebX.maYIadrTaRb...
> Does anybody know how to use VBA to acces the custom properties in AutoCAD
> (dwgprops command in AutoCAD)? I know you can determine if a file is
> read-only, archive, etc. through VBA, but I'd like to be able to determine
> the values of some custom properties that I've set up without opening a
> .dwg.
>
0 Likes