PublicFunction GetFamColSymbols() As ArrayList Dim model As IpfcModel Dim FamMember As IpfcFamilyMember Dim FamMemberCols As IpfcFamilyTableColumns Dim i AsInteger Dim ColSymbols AsNew ArrayList Try model = asyncConnection.Session.CurrentModel If model IsNothingThen ReturnNothing EndIf If (Not model.Type = EpfcModelType.EpfcMDL_PART) And (Not model.Type = EpfcModelType.EpfcMDL_ASSEMBLY) Then ReturnNothing EndIf FamMember = CType(model, IpfcFamilyMember) FamMemberCols = FamMember.ListColumns() If FamMemberCols.Count = 0Then ReturnNothing EndIf ColSymbols.Add("实例名") For i = 0To FamMemberCols.Count - 1 ColSymbols.Add(FamMemberCols.Item(i).Symbol) Next Return ColSymbols Catch ex As Exception ReturnNothing EndTry EndFunction
PublicFunction GetFamRow(ByVal row AsInteger) As ArrayList Dim model As IpfcModel Dim FamMember As IpfcFamilyMember Dim FamMemberCols As IpfcFamilyTableColumns Dim FamMemberRows As IpfcFamilyTableRows Dim Value As IpfcParamValue Dim instmodel As IpfcModel Dim i AsInteger Dim FamRow AsNew ArrayList Try model = asyncConnection.Session.CurrentModel If model IsNothingThen ReturnNothing EndIf If (Not model.Type = EpfcModelType.EpfcMDL_PART) And (Not model.Type = EpfcModelType.EpfcMDL_ASSEMBLY) Then ReturnNothing EndIf FamMember = CType(model, IpfcFamilyMember) FamMemberCols = FamMember.ListColumns() FamMemberRows = FamMember.ListRows() If FamMemberCols.Count = 0Then ReturnNothing EndIf instmodel = FamMemberRows.Item(row).CreateInstance() FamRow.Add(instmodel.InstanceName) For i = 0To FamMemberCols.Count - 1 Value = FamMember.GetCell(FamMemberCols.Item(i), FamMemberRows.Item(row)) SelectCase Value.discr Case EpfcParamValueType.EpfcPARAM_BOOLEAN FamRow.Add(CStr(Value.BoolValue)) Case EpfcParamValueType.EpfcPARAM_DOUBLE FamRow.Add(CStr(Value.DoubleValue)) Case EpfcParamValueType.EpfcPARAM_INTEGER FamRow.Add(CStr(Value.IntValue)) Case EpfcParamValueType.EpfcPARAM_STRING FamRow.Add(Value.StringValue) CaseElse FamRow.Add("") EndSelect Next FamMemberRows.Item(row).Erase() Return FamRow Catch ex As Exception MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString) ReturnNothing EndTry EndFunction