【c# ord】如何获取第一层元素的几何属性

如上图,我想获取到这顶层元素的Geometry,请问如何筛选

以下是我的代码,它能够实现获取所有EC属性,但我不知道如何筛选顶层元素的几何属性

            ScanCriteria sc = new ScanCriteria();
            sc.SetModelRef(Session.Instance.GetActiveDgnModel());
            sc.SetModelSections(DgnModelSections.GraphicElements);
            sc.SetDrawnElements();
            DgnModelRef dgnModelRef = Bentley.MstnPlatformNET.Session.Instance.GetActiveDgnModelRef();
            List<Element> elmtsList = new List<Element>();

            ScanDelegate scanDelegate = (Element elmt, DgnModelRef modelRef) =>
            {
                elmtsList.Add(elmt);
                return StatusInt.Success;
            };
            sc.Scan(scanDelegate);

            foreach (Element elmt in elmtsList)
            {
                if(elmt == null)
                {
                   return;
                    
                }

                DgnECInstanceCollection dgnECInstanceCollection = DgnECManager.Manager.GetElementProperties(elmt, ECQueryProcessFlags.SearchAllClasses);
                if (dgnECInstanceCollection == null)
                {
                    //
                }
                foreach (IDgnECInstance inst in dgnECInstanceCollection)
                {
                    if (inst == null)
                    {
                        //
                    }
                    count++;
                    foreach(var propertyValue in inst)
                    {
                        string strVal;
                        double dblVal;
                        int intVal;
                        if (propertyValue.TryGetStringValue(out strVal))
                        {

                            string content = "\tProperty=" +"value=" + strVal;

                        }
                        else if (propertyValue.TryGetDoubleValue(out dblVal))
                        {

                            string content = "\tProperty="  + ", Value=" + dblVal;
                        }
                        else if (propertyValue.TryGetIntValue(out intVal))
                        {
                            string content = "\tProperty=" + ", Value=" + intVal;

                        }

                    }

Parents Reply Children
No Data