hi~
I want to get properties by category. Just like the title in the picture below to classify and export. But only the customized ones that I export can not be exported by clicking here. The circles in the picture are uniformly assigned to "BREP cells". How to classify each class?
Here is my code. Thank you very much.
code:
IEnumerator<Element> iEe = dgnModel.GetGraphicElements().GetEnumerator(); iEe.Reset(); while (iEe.MoveNext()) { Element elTmp = iEe.Current; LogLine = string.Format("ElementId : {0} ClassType : {1} ElemenType : {2} ElemenTypeName : {3}", elTmp.ElementId.ToString(), elTmp.GetType().ToString(), elTmp.ElementType, elTmp.TypeName); WriteLogLine(LogLine); Element myElem = dgnModel.FindElementById((ElementId)elTmp.ElementId); if(myElem ==null) { } DgnECManager ecManager = DgnECManager.Manager; int count = 0; DgnECInstanceCollection instCol = ecManager.GetElementProperties(myElem, ECQueryProcessFlags.SearchAllClasses); foreach (IDgnECInstance inst in instCol) { count++; LogLine = "----ECInstance" + count.ToString() + "[" + inst.ClassDefinition.DisplayLabel + "]"; WriteLogLine(LogLine); IEnumerator<IECProperty> propertyEnum = inst.ClassDefinition.GetEnumerator(); while (propertyEnum.MoveNext()) { IECPropertyValue propertyValue = inst.GetPropertyValue(propertyEnum.Current.Name); if (propertyValue.IsArray) { IECArrayValue arrayVal = propertyValue as IECArrayValue; if (arrayVal.Count >= 1) propertyValue = arrayVal[0]; } string strVal; double dblVal; int intVal; var a = propertyValue.Type; if (propertyValue.TryGetStringValue(out strVal)) { LogLine = "\tProperty=" + propertyEnum.Current.DisplayLabel + ", stringValue=" + strVal; WriteLogLine(LogLine); //LogLine = UnicodeToString("u53c2"); //WriteLogLine(LogLine); } else if (propertyValue.TryGetDoubleValue(out dblVal)) { LogLine = "\tProperty=" + propertyEnum.Current.DisplayLabel + ", doubleValue=" + dblVal.ToString(); WriteLogLine(LogLine); } else if (propertyValue.TryGetIntValue(out intVal)) { LogLine = "\tProperty=" + propertyEnum.Current.DisplayLabel + ", intValue=" + intVal.ToString(); WriteLogLine(LogLine); } } }
My current export is as shown in Figure.
Only customization is exported by a separate category. The rest is divided into "BREP cells". I want to export separately.
Thank you to everyone in the community
It's not clear what you're asking. You have exported ...
john siomn said: I want to export separately.
What do you want to export? Just the Item Type data? You don't need to write any code to achieve that — take a look at MicroStation Reports.
Regards, Jon Summers LA Solutions
Well, I mean. How to get the content in the red box separately.
thank you
With regards
john siomn said:How to get the content in the red box
Your screenshot is too small. I can't read it.