Dim info AsString Dim model As IpfcModel Dim solid As IpfcSolid Dim features As IpfcFeatures Dim modelItem As IpfcModelItem Dim i AsInteger info = "" i = 0 model = asyncConnection.Session.CurrentModel solid = CType(model, IpfcSolid) features = solid.ListFeaturesByType(False, EpfcFeatureType.EpfcFeatureType_nil) ForEach feature As IpfcFeature In features modelItem = CType(feature, IpfcModelItem) info += "序号:" + (i + 1).ToString() + " ID:" + modelItem.Id.ToString() + " 名称:" + modelItem.GetName() + " 类型:" + features.Item(i).FeatTypeName + Chr(13) i = i + 1 Next
Dim selectionOptions As IpfcSelectionOptions Dim selections As CpfcSelections Dim selectFeats As IpfcSelection Dim selectedfeat As IpfcModelItem Dim feature As IpfcFeature Dim model As IpfcModel Dim solid As IpfcSolid Dim featureOperations AsNew CpfcFeatureOperations '应该是CpfcFeatureOperations!帮助文档有误 Dim deleteOperation As IpfcDeleteOperation Dim regenInstructions As IpfcRegenInstructions '初始化selection选项 selectionOptions = (New CCpfcSelectionOptions).Create("feature") '设置可选特征的类型,这里为特征对象 selectionOptions.MaxNumSels = 1'设置一次可选择特征的数量 selections = asyncConnection.Session.Select(selectionOptions, Nothing) '确定选择了一个对象 If selections.Count > 0Then selectFeats = selections.Item(0) selectedfeat = selectFeats.SelItem '由于选择项确定为feature类型,所以这里可以安全的将父类转化为子类 feature = CType(selectedfeat, IpfcFeature) '删除需要通过IpfcSolid进行,由于我们在操作过程中保证是打开了Prt,所以这里可以安全的将父类转化为子类(asm也是一样的处理) model = asyncConnection.Session.CurrentModel solid = CType(model, IpfcSolid) '生成删除选项 deleteOperation = feature.CreateDeleteOp() deleteOperation.Clip = True'是否删除该特征后的所有选项,本例设置为真。其余的删除选项请查看帮助文档。 featureOperations.Append(deleteOperation) '生产删除操作的重生选项 regenInstructions = (New CCpfcRegenInstructions).Create(True, True, Nothing) regenInstructions.UpdateInstances = False'是否更新内存。其余的选项请查看帮助文档。 solid.ExecuteFeatureOps(featureOperations, regenInstructions) 'regenInstructions是可选选项,也可以直接设置为Nothing EndIf '使用函数刷新,也很简单 asyncConnection.Session.CurrentWindow.Refresh()
Dim datasource As IpfcIntfStep Dim featattr As IpfcImportFeatAttr Dim model As IpfcModel Dim solid As IpfcSolid Dim coordsystem As IpfcCoordSystem Dim selectionOptions As IpfcSelectionOptions Dim selections As CpfcSelections Dim selectCoordsystems As IpfcSelection Dim selectedcoordsystem As IpfcModelItem