cancel
Showing results for 
Search instead for 
Did you mean: 

NXOpen Visual Basic: Set boundary stock in Fixed Contour operation

Pioneer
Pioneer

I am looking for an NXOpen example using VB. Using ONT selection, I want to set the boundary stock on all boundaries in the selected Fixed Contour operation to a specific value. I am also interested in iterating through the curve members of each boundary and set specific stock values based on if the tool position is ON or Tanto for that curve member. Any examples would be greatly appreciated. I have been able to set the tool vector to match that of the WCS, but this specific task has me stumped.

9 REPLIES

Re: NXOpen Visual Basic: Set boundary stock in Fixed Contour operation

Pioneer
Pioneer

Any example at all of using boundaries within CAM operations would be greatly appreciated.

Re: NXOpen Visual Basic: Set boundary stock in Fixed Contour operation

Phenom
Phenom

Re: NXOpen Visual Basic: Set boundary stock in Fixed Contour operation

Pioneer
Pioneer

I have seen all these examples and only one of them deals with boundaries within operations. The one that does deal with boudaries within an operation doesn't run without an error.

Re: NXOpen Visual Basic: Set boundary stock in Fixed Contour operation

Pioneer
Pioneer

I am still looking for any help on this. Rather than set the stock on a CamGeomType.CamDrive type boundary, I am attempting to just count the number of drive boundaries within a fixed contour operation. With the code I have pulled together, I get the error "Object is not the desired type". Any help would be appreciated. Here is my code:

 

 

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module ask_boundary_count

    Dim theSession As Session = Session.GetSession()
    Dim WorkPart As Part = theSession.Parts.Work
    Dim DisplayPart As Part = theSession.Parts.Display
    Dim ufs As UFSession = UFSession.GetUFSession()
    Dim lw As ListingWindow = theSession.ListingWindow

    Sub Main()
        If WorkPart IsNot Nothing Then
            Dim setupTag As Tag
            ufs.Cam.InitSession()
            ufs.Setup.AskSetup(setupTag)
            Try
                Dim selectedTags() As NXOpen.Tag
                Dim selectedCount As Integer
                lw.Open()
                lw.WriteLine(vbLf & "Searching for selected nodes...")
                ufs.UiOnt.AskSelectedNodes(selectedCount, selectedTags)
                If selectedCount <= 0 Then
                    lw.WriteLine("No CAM node selected...exit")
                    Return
                End If
                lw.WriteLine(" Found " & selectedCount & " selected nodes...")
                Dim inx As Integer = 0
                Dim setBnd() As IntPtr
                ufs.Cambnd.AskBoundaries(selectedTags(0), CamGeomType.CamDrive, inx, setBnd)
                lw.WriteLine("count " & inx)
            Catch ex As NXOpen.NXException
                lw.Open()
                lw.WriteLine("Error: ")
                lw.WriteLine(ex.Message)
            End Try
        End If
    End Sub

End Module

 

 

Re: NXOpen Visual Basic: Set boundary stock in Fixed Contour operation

The good news is that as the boundary dialogs are updated, the API is there. These are the dialogs with the two lists and custom boundary and member data above each list:

new_boundary_dialog.jpg

 

The bad news is that surface controuing bourdary drive method still uses the old style dialogs.

 

If you find a way to use boundaries in a geometry group with the new UI, you should not have any trouble.

 

I am not sure what your application is, but you may be able to use curve/point drive method.

Mark Rief
Retired Siemens

Re: NXOpen Visual Basic: Set boundary stock in Fixed Contour operation

Pioneer
Pioneer

Thanks for the reply, Mark, but I am looking to find and set the boundary data via NXOpen and not through the dialogs. Any help with this through Visual Basic would be appreciated.

Re: NXOpen Visual Basic: Set boundary stock in Fixed Contour operation

Esteemed Contributor
Esteemed Contributor

rvogel wrote:

Thanks for the reply, Mark, but I am looking to find and set the boundary data via NXOpen and not through the dialogs.


The point is, that you can record a Journal of the task in one of the operations with a new dialog to get a blueprint for your code.

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: NX12.0

How to Get the Most from Your Signature in the Community

Re: NXOpen Visual Basic: Set boundary stock in Fixed Contour operation

Pioneer
Pioneer

Yes, I understand that, but my point is that a curve/point drive method is not a boundary method.

I am looking for access to the boundaries selected in a boundary drive method. If that is not posible then I will need to wait for the API to catch up. It is posible to access trim boundaries, but I am looking for CamDrive specifically.

Re: NXOpen Visual Basic: Set boundary stock in Fixed Contour operation

Esteemed Contributor
Esteemed Contributor

The builders are similar only the boundary type is different, so if you mange to get one working, you just have to change the boundary type.

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: NX12.0

How to Get the Most from Your Signature in the Community