PrivateFunction GetSubassemblyinfo(ByRef i AsInteger, ByVal ModelDescr As IpfcModelDescriptor, ByVal level AsInteger) AsString Dim model As IpfcModel Dim solid As IpfcSolid Dim components As IpfcFeatures Dim info AsString = "" Dim j AsInteger Dim tabstr AsString = "" Dim modelItem As IpfcModelItem Dim componentFeat As IpfcComponentFeat model = asyncConnection.Session.GetModelFromDescr(ModelDescr) solid = CType(model, IpfcSolid) components = solid.ListFeaturesByType(True, EpfcFeatureType.EpfcFEATTYPE_COMPONENT) For j = 0To level tabstr += vbTab Next ForEach component As IpfcFeature In components modelItem = CType(component, IpfcModelItem) componentFeat = CType(component, IpfcComponentFeat) info += tabstr + "序号:" + (i + 1).ToString() + " ID:" + modelItem.Id.ToString() + " 名称:" + componentFeat.ModelDescr.InstanceName + " 类型:" + componentFeat.ModelDescr.GetExtension() + Chr(13) i = i + 1 If componentFeat.ModelDescr.Type = EpfcModelType.EpfcMDL_ASSEMBLY Then info += GetSubassemblyinfo(i, componentFeat.ModelDescr, level + 1) EndIf Next Return info EndFunction