hexagon logo

Lot of Variables in script

Hi iam new to PCDMIS but not to programming Slight smile. i have the problem that i have to calculate a few hundred measurement points from before measured dimensionpoints in a Basic Script ...
Looking now for the easiest way to get all the before measured Variablevalues (more than 30 Variables) to the Subroutine for this calculations...
Does anyone know the max number of arguments for the Script Command ... sorry german language version
S2 =SKRIPT/DATEINAME= C:\TRAINING\SKRIPT1.BAS
FUNKTION/ShowVars,EINBLENDEN=JA,ARG1=USER,ARG2=FIELDSZV,ARG3=PRO,,


or would it be handier if i use getVariables ...????
Dim App As Object Set App = CreateObject ("PCDLRN.Application") Dim Part As Object Set Part = App.ActivePartProgram Dim Var As Object Set Var = Part.GetVariableValue ("V1")
but than i have the question how i get the result from a measured point (like pkt2.x.meas)
thanks in advance for any hints!
eric
Parents
  • Dim App As Object 
    Set App = CreateObject ("PCDLRN.Application")
    Dim Part As Object
    Set Part = App.ActivePartProgram
    Dim Commands As Object
    Set Commands = Part.Commands
    CommandCount = Commands.Count
    Dim Command As Object
    Set Command = Commands.Item(CommandCount)
    
    Set ID As String
    ID = "PKT2"
    
    For Each Command In Commands
    If Command.ID = ID Then
    XMEAS = Command.GetText(MEAS_X, 0)
    End If
    Next Command
    
    End Sub


    Coded off the top of my head, not sure if it will work without editing.
Reply
  • Dim App As Object 
    Set App = CreateObject ("PCDLRN.Application")
    Dim Part As Object
    Set Part = App.ActivePartProgram
    Dim Commands As Object
    Set Commands = Part.Commands
    CommandCount = Commands.Count
    Dim Command As Object
    Set Command = Commands.Item(CommandCount)
    
    Set ID As String
    ID = "PKT2"
    
    For Each Command In Commands
    If Command.ID = ID Then
    XMEAS = Command.GetText(MEAS_X, 0)
    End If
    Next Command
    
    End Sub


    Coded off the top of my head, not sure if it will work without editing.
Children
No Data