Cancel
Showing results for 
Search instead for 
Did you mean: 

How to step into a process step with custom.vb

Community Manager Community Manager
Community Manager

Place the following line within your custom.vb where you need to jump to a specific process step, replacing,  YourProcessStepName, with your name of your process step in quetion.  An example might be when you need to create the CAD model before stepping into other processes when running via Unattended Engineer:

 

SetProcessStep("YourProcessStepName", rootpart)

 

Note: The SetProcessStep function loops through all process steps

 

Then elsewhere in the custom.vb place the following code:

 

    'Function that finds a specified process step and returns the object

    Private Sub SetProcessStep(ByVal sproc As String, ByRef epart As Part)

 

        'selected process step

        Dim sProcessStep As ProcessStep = Nothing

 

        'loop through all procesteps, find the process step passed by sproc

 

        For i As Integer = 1 To RootPart.ProcessSteps.Count

            Dim oProcessStep As ProcessStep = CType(RootPart.ProcessSteps.Item(i), ProcessStep)

            If oProcessStep.Name.Contains(sproc) Then

                sProcessStep = oProcessStep

                Exit For

            End If

        Next

 

        g_RsEngineer.SelectProcessStep(sProcessStep, epart, -1, 0)

 

    End Sub