cancel
Showing results for 
Search instead for 
Did you mean: 

CAM : cutting parameters vb

Genius
Genius

hello ,

 

I created a code that changes the cutting parameters on selected operations, for this I used the example SampleNXOpenApplications / OntSelectionBoilerPlate.vb in the NX file

I select the operations, and I have a dialog box that appears, asking me to put an thickness, for now everything works, for I have to go against my value every time, there is a possibility that this dialog box appears only once for all selected operations ?, and that my value applies for all operations
I am beginner in programming vb

Thank you for your help

 

@mkn
4 REPLIES

Re: CAM : cutting parameters vb

Esteemed Contributor
Esteemed Contributor

To only enter the value once, make sure to ask for it outside of the loop that cycles through the operations.

 

Would be good to post your code, so we can see what you really have and don't rely on guessing Smiley Wink

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: CAM : cutting parameters vb

Genius
Genius

 it's true !! Smiley Embarassed

 

    Function CutParameters(ByVal operationBuilder As CAM.OperationBuilder) As Boolean
        'What type of a builder is this?
        If TypeOf operationBuilder Is CAM.MillOperationBuilder Then
            Dim millOperationBuilder As CAM.MillOperationBuilder = operationBuilder
            'From the Operation Builder get the Cutting Parameters Object
            Dim cutParams As CAM.MillCutParameters = millOperationBuilder.CutParameters
			REM Dim CurrentName = new  camObject.Name()
		    REM Dim CurrentName As String = camObject.Name()

            ' Now we are ready to change the parameters of cutting
				
				cutParams.PartStock.Value = (NXInputBox.GetInputString("Surépaisseur de Coupe:","Valeur","0"))
				
				

            Return True
        End If
        Return False
		

    End Function

 

@mkn

Re: CAM : cutting parameters vb

Esteemed Contributor
Esteemed Contributor
Dim thePartStock As Double = NXInputBox.GetInputNumber("Surépaisseur de Coupe:","Valeur",0.0)

CutParameters(theOperationBuilder, thePartStock)

Function CutParameters(ByVal operationBuilder As CAM.OperationBuilder, ByVal PartStockValue As Double) As Boolean
    'What type of a builder is this?
    If TypeOf operationBuilder Is CAM.MillOperationBuilder Then
        Dim millOperationBuilder As CAM.MillOperationBuilder = operationBuilder
        'From the Operation Builder get the Cutting Parameters Object
        Dim cutParams As CAM.MillCutParameters = millOperationBuilder.CutParameters
        REM Dim CurrentName = new  camObject.Name()
        REM Dim CurrentName As String = camObject.Name()

        ' Now we are ready to change the parameters of cutting

        cutParams.PartStock.Value = PartStockValue

        Return True
    End If
    Return False
End Function

Something along these lines Smiley Wink

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: CAM : cutting parameters vb

Genius
Genius

Yes Smiley Tongue

 

thanks

@mkn