링크 참조 : 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;