How do you access custom properties in the properties dialog box? TIA
If you're using a release prior to 2004, the following: 'Set custom drawing property ' Public Function TestSetDrawingProperty() As String Const DICTIONARY_NAME = "DWGPROPS" Dim DwgInfo As AcadXRecord Dim DataType As Variant Dim Data As Variant Dim i As Long Dim sType As String, sValue As String Dim iType As Integer Dim vProp As Variant 'Title = 0 'Subject = 1 'Author = 2 'Comments = 3 'Keywords = 4 On Error GoTo HandleError Set DwgInfo = ThisDrawing.Dictionaries(DICTIONARY_NAME) DwgInfo.GetXRecordData DataType, Data 'change title: sValue = "Kevin" iType = 1 Data(iType) = sValue DwgInfo.SetXRecordData DataType, Data 'change a custom field (assumes there is a custom field called NAME): sType = "NAME" sValue = "Kevin" For i = LBound(Data) To UBound(Data) If DataType(i) >= 300 And DataType(i) <= 309 Then If Left(CStr(Data(i)), Len(sType)) = sType Then vProp = sType & "=" & sValue Data(i) = vProp DwgInfo.SetXRecordData DataType, Data Exit For End If End If Next 'look at all of them: For i = LBound(Data) To UBound(Data) Debug.Print Data(i) Next Exit Function HandleError: Set DwgInfo = Nothing End Function for 2004 & later: Public Function SetDrawingProperty(sProp As String, sValue As String) As Boolean Dim DwgInfo As AcadSummaryInfo Dim i As Long Dim iNum As Long 'Dim sKey As String, sValue As String Dim sKey As String, sValue2 As String Dim bSuccess As Boolean On Error GoTo Err_SetDrawingProperty Set DwgInfo = ThisDrawing.SummaryInfo iNum = DwgInfo.NumCustomInfo For i = 1 To iNum DwgInfo.GetCustomByIndex i, sKey, sValue2 If sKey = sProp Then DwgInfo.SetCustomByIndex i, sProp, sValue bSuccess = True Exit For End If Next If Err.Number = 0 Then SetDrawingProperty = bSuccess Else SetDrawingProperty = False End If Set DwgInfo = Nothing Exit Function Err_SetDrawingProperty: SetDrawingProperty = False Set DwgInfo = Nothing End Function Kevin
Thanks, but what I am referring to is the regular old properties dialog window. The one that shows the object type, length, radius, etc.
L, Did you ever consider that the "regular old properties" could be the regular properties of the object being displayed? Such as: Object.Name, Object.Top or a concatonation of existing properties etc. I've got to be blinded by simplicity because I'm missing the logic in your question. Can you expand for the simple mind? Regards, Bob Coward CADS, Inc
hi bob, you never explained how to msgbox the filename of a file dragged into autocad... but alas that's another topic there are ways to add custom properties to an object through menus. For example I have polyline representing an inlet/catch basin . In the custom properties I have the id#, grate elevation, elevations for the pipes coming in and going out. They show up in my properties window. a list shows that the objects class is 'inlet'. But I don't know how to programmatically get the info stored in these custom properties. Don't even know how to tell how they are stored. thanks
There are ways to access custom properties that appear in the Properties window. But, there are many ways to implement custom properties, so you woud need to be a bit more specific about what AutoCAD based vertical product you're using.
Civil Series 2004. I discovered the custom properties in the map menu. Sorry Anne for the triple posting. This NG was the only one where I got any response. The custom properties seem really valuable if I can find a way to use them.