public SWTableType(ModelDoc2 md, string tablehash) { _masterHash = tablehash; _masterHashes[0] = _masterHash; part = md; swSelMgr = (SelectionMgr)part.SelectionManager; if (part != null && swSelMgr != null) { BomFeature swBom = null; try { swBom = (BomFeature)swSelMgr.GetSelectedObject6(1, -1); found_bom = swBom; } catch { // } if (swBom != null) { fill_table(swBom); } else { find_bom(); } } }
private void fill_table(BomFeature bom) { found_bom = bom; string itno = string.Empty; string ptno = string.Empty; _cols.Clear(); _prts.Clear(); swTable = (ITableAnnotation)bom.IGetTableAnnotations(1); part.ClearSelection2(true); _col_count = swTable.ColumnCount; find_part_column(); _row_count = swTable.RowCount; for (int i = 0; i < _col_count; i++) { _cols.Add(swTable.get_DisplayedText(0, i)); } object[] bomtaa = (object[])bom.GetTableAnnotations(); BomTableAnnotation bta = (BomTableAnnotation)bomtaa[0]; int prtcol = get_column_by_name(_part_column); for (int i = 0; i < _row_count; i++) { string prt_ = swTable.get_DisplayedText(i, prtcol); _prts.Add(prt_); string[] pathnames = (string[])bta.GetModelPathNames(i, out itno, out ptno); if (pathnames != null) { foreach (string pathname in pathnames) { FileInfo fi_ = new FileInfo(pathname); path_list.Add(fi_); if (!path_dict.ContainsKey(prt_.ToUpper())) { path_dict.Add(prt_.ToUpper(), fi_); } } } } initialated = true; }
public IBomFeatureObject(IBomFeature IBomFeatureinstance) { IBomFeatureInstance = IBomFeatureinstance; }