Access to data objects

Access to data objects

Anonymous
Not applicable
358 Views
1 Reply
Message 1 of 2

Access to data objects

Anonymous
Not applicable
Hi everyone

Many people asked about how to access to user data objects. I think the best way is this:

Dim cls_manager As Autodesk.Gis.Map.Classification.ClassificationManager = Nothing
cls_manager = Autodesk.Gis.Map.HostMapApplicationServices.Application.ActiveProject.ClassificationManager

Dim objClass_Property As FeatureClassPropertyCollection = New FeatureClassPropertyCollection()
Dim list_values As System.Collections.ArrayList = Nothing

cls_manager.GetProperties(objClass_Property, list_values, objId)
Dim Class_Property As FeatureClassProperty = Nothing

For Each Class_Property In objClass_Property
Dim propName As System.String = Class_Property.Name
Dim propValue As String = Class_Property.DefaultValue.ToString
Utility.ShowMsg(vbNewLine & propName)
Utility.ShowMsg(vbNewLine & propValue)
Next



I hope it will be useful for someone. . .
Suggestions?
0 Likes
359 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
The "user data" you referred here is "Classified Feature" data, which is
only available to AutoCAD MAP (2006 or newer). This is generic AutoCAD NG,
readers who do not use Acad MAP have no idea what you are talking and what
this post is for. The better place for this post would be NG
"autodesk.map.developer"

In generic AutoCAD .NET API, there is actually something called UserData:
Document.UserData, which is a Hashtable type object, used for store user
data per document. Of course it is also avaiable in Acad MAP drawing.


"El Haj" wrote in message news:5914993@discussion.autodesk.com...
Hi everyone

Many people asked about how to access to user data objects. I think the best
way is this:

Dim cls_manager As Autodesk.Gis.Map.Classification.ClassificationManager =
Nothing
cls_manager =
Autodesk.Gis.Map.HostMapApplicationServices.Application.ActiveProject.ClassificationManager

Dim objClass_Property As FeatureClassPropertyCollection
= New FeatureClassPropertyCollection()
Dim list_values As System.Collections.ArrayList =
Nothing

cls_manager.GetProperties(objClass_Property,
list_values, objId)
Dim Class_Property As FeatureClassProperty = Nothing

For Each Class_Property In objClass_Property
Dim propName As System.String = Class_Property.Name
Dim propValue As String =
Class_Property.DefaultValue.ToString
Utility.ShowMsg(vbNewLine & propName)
Utility.ShowMsg(vbNewLine & propValue)
Next



I hope it will be useful for someone. . .
Suggestions?
0 Likes