private static void test_GetDocumentsFromSelectSet() { Inventor.Application oApp = ApplicationShim.CurrentInstance(); SelectSet oSSet = oApp.ActiveDocument.SelectSet; if (oSSet.Count == 0) { oSSet.Select(oApp.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select thing(s)...")); } if (oSSet.Count == 0) { return; } List <Document> documentList = new List <Document>(); documentList = DocumentShim.GetDocumentsFromSelectSet(oSSet); Console.WriteLine("Number of documents in List: " + documentList.Count().ToString()); foreach (Document i in documentList) { // Console.WriteLine(i.FullFileName); } Console.WriteLine("Press Enter to Exit!"); Console.ReadLine(); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// protected void SelectInventorFeatures() { SelectSet ss = AdnInventorUtilities.InvApplication.ActiveDocument.SelectSet; ss.Clear(); foreach (TreeNode node in TreeView.SelectedNodes) { if (node.Tag is PartFeature) { ss.Select(node.Tag); } } }