Hi,
I'd like to get types (or at least normal names) from string collection Autodesk.Aec.PropertyData.DatabaseServices.PropertySetDefinition.AppliesToFilter.
I have no idea how to convert "AcDb3dSolid, AcDbSurface, AeccDbSurfaceTin, AcDbFace, AcDbBody, AcDb3dPolyline, AeccDbFeatureLine, AeccDbAlignment, AeccDbVAlignment ..." to types Autodesk.AutoCAD.DatabaseServices.Solid3d, TinSurface, Alignment, etc.
I've tried RXObject and RXClass but they don't have methods with string.
Reflection won't help because AcDbs are internal structs. Neither removing substrings "AcDb" or "AeccDb" and trying to get the type from the assembly works.
public static void GetPropertySets(Entity ent, Transaction tr)
{
ObjectIdCollection psdColl = PropertyDataServices.GetPropertySets(ent);
foreach (ObjectId objId in psdColl)
{
PropertySet ps = objId.GetObject(OpenMode.ForRead) as PropertySet;
ObjectId idDef = ps.PropertySetDefinition;
PropertySetDefinition propSetGroup = (PropertySetDefinition)tr.GetObject(idDef, OpenMode.ForRead);
foreach (string obj in propSetGroup.AppliesToFilter)
{
// get type from stirng??
}
}
}
Thanks for help.
Michal
Solved! Go to Solution.
Solved by michal_hcz. Go to Solution.
Solved by hippe013. Go to Solution.
Maybe try with reflection.
string objectType = "AcDb3dSolid";
Assembly asm = typeof(Solid3d).Assembly;
Type type = asm.GetType(objectType);
Thank you guys.
List<string> rxClassNames = new List<string>();
var dict = SystemObjects.ClassDictionary;
string[] eligibleClassNames = PropertyDataServices.FindEligibleClassNames();
foreach (string className in eligibleClassNames)
{
if (dict.Contains(className))
{
RXClass cl = (RXClass)dict[className];
rxClassNames.Add(cl.DxfName);
}
}
Can't find what you're looking for? Ask the community or share your knowledge.