Quantcast
Channel: NX Journaling - Journaling / NXOpen API
Viewing all articles
Browse latest Browse all 783

How to get point and vector selected in blockstyler ?

$
0
0

Hi,

In the following code I tried to create point and axis after selecting with block styler

But I have a problem to terminate the 2 lines above

Dim thePoint As Point = s.Parts.Work.Points.CreatePoint(
Dim revolve_axis As Axis = s.Parts.Work.Axes.CreateAxis(

Thanks in advance

Regards

Didier
___________________________________________________________

Option Strict Off
Imports NXOpen
Imports NXOpen.BlockStyler
 
Public Class Dialog
    Private Shared s As Session
    Private Shared theUI As UI
    Private theDlxFileName As String = "axis_and_point.dlx"
    Private theDialog As BlockStyler.BlockDialog
 
    Private block_axe As NXOpen.BlockStyler.SpecifyAxis '
    Dim propList As PropertyList = Nothing
 
    Public Sub New()
        Try
            s = Session.GetSession()
            theUI = UI.GetUI()
            theDialog = theUI.CreateDialog(theDlxFileName)
            theDialog.AddApplyHandler(AddressOf apply_cb)
            theDialog.AddInitializeHandler(AddressOf initialize_cb)
            theDialog.AddDialogShownHandler(AddressOf dialogShown_cb)
            theDialog.AddUpdateHandler(AddressOf update_cb)
            theDialog.AddOkHandler(AddressOf ok_cb)
 
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
    Public Sub initialize_cb()
        Try
        Catch ex As Exception
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
        End Try
    End Sub
    Public Sub dialogShown_cb()
        Try
        Catch ex As Exception
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
        End Try
    End Sub
    Public Sub Show()
        Try
            theDialog.Show()
            block_axe = theDialog.TopBlock.FindBlock("axis0")
 
        Catch ex As Exception
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
        End Try
    End Sub
    Public Sub Dispose()
        If theDialog IsNot Nothing Then
            theDialog.Dispose()
            theDialog = Nothing
        End If
    End Sub
    Public Function update_cb(ByVal block As UIBlock) As Integer
        Dim propList As PropertyList = Nothing
 
        Try
 
        Catch ex As Exception
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
        End Try
 
        update_cb = 0
    End Function
    Public Function apply_cb() As Integer
        Dim errorCode As Integer = 0
        Try
 
        Catch ex As Exception
            errorCode = 1
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
        End Try
        apply_cb = errorCode
    End Function
    Public Function ok_cb() As Integer
        Dim errorCode as Integer = 0
        Try
            propList = block_axe.GetProperties
 
            Dim thePoint As Point = s.Parts.Work.Points.CreatePoint(
            Dim revolve_axis As Axis = s.Parts.Work.Axes.CreateAxis(
 
        Catch ex As Exception
            errorCode = 1
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
        End Try
        ok_cb = errorCode
    End Function
 
End Class

Viewing all articles
Browse latest Browse all 783

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>