Your Products have been synced, click here to refresh
Dim DmisApp As Object Dim DmisPart As Object Dim Commands As Object Dim Command As Object Dim TraceCommand As Object Sub Main Set DmisApp = CreateObject("PCDLRN.Application") Set DmisPart = DmisApp.ActivePartProgram Set Commands = DmisPart.Commands For Each Command In Commands If Command.IsTraceField Then Set TraceCommand = Command.TraceFieldCommand MsgBox TraceCommand.Name + " " + TraceCommand.Value Set TraceCommand = Nothing End If Next Command Set Commands = Nothing Set DmisPart = Nothing Set DmisApp = Nothing End Sub
Dim PCDApp As Object Dim Part As Object Dim Cmds As Object Dim Cmd As Object Dim TCmd As Object Dim TCmds As Object Set PCDApp = CreateObject("PCDLRN.Application") Set Part = PCDApp.ActivePartProgram Set Cmds = Part.Commands Dim VSERIALNUMBER As Object For Each Cmd In Cmds Set TCmd = Cmd.TraceFieldCommand Set VSERIALNUMBER = TCmd("Serial Number").GetText Next Cmd
You need to check first that the current command is a tracefield command by using the "if cmd.istracefield" logic shown above.
Otherwise the tracefield member of the current command will be empty resulting in the error you are getting.
Sent from my SPH-L710 using Tapatalk
Dim PCDApp As Object Dim Part As Object Dim Cmds As Object Dim Cmd As Object Dim TCmd As Object Dim TCmds As Object Set PCDApp = CreateObject("PCDLRN.Application") Set Part = PCDApp.ActivePartProgram Set Cmds = Part.Commands Dim VSERIALNUMBER As Object For Each Cmd In Cmds If Cmd.IsTracefield Then Set TCmd = Cmd.TraceFieldCommand Set VSERIALNUMBER = TCmd("Serial Number").GetText End If Next Cmd
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |