기본 콘텐츠로 건너뛰기

3월, 2017의 게시물 표시

Microstation V8i .NET Programming

링크 참조 : http://theactoflearning.blogspot.kr/2014/06/microstation-add-in-creating-add-in.html public static void ItemAttachCommand(string unparsed) { ElementScanCriteria sc = new ElementScanCriteriaClass(); { sc.ExcludeAllTypes(); sc.IncludeType(MsdElementType.CellHeader); sc.IncludeType(MsdElementType.Surface); } int i = Bentley.MicroStation.InteropServices.Utilities.ComApp.ActiveModelReference.MdlModelRefP(); XmlInstanceSchemaManager oSchemaManager = new XmlInstanceSchemaManager(new IntPtr(i)); IList<string> oSchemas = oSchemaManager.ReadSchemas(); XmlInstanceApi oXmlInstanceApi = XmlInstanceApi.CreateApi(oSchemaManager); ElementEnumerator ee = Bentley.MicroStation.InteropServices.Utilities.ComApp.ActiveModelReference.Scan(sc); while (ee.MoveNext()) { CellElement oCell = ee.Current.AsCellElement(); //if (("Component_0001388c-0000-0000-7409-f9ad8c553b82" != oCell.Name)) continue;