Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX open for feauture recognition

Status
Not open for further replies.

Zoes

Mechanical
Sep 30, 2011
46
GB
Hi,

Wondering how can I extend the code bellow to recognise all design features in a model?
Will be quite useful for a simple model to recognise that there is a block and then validate its dimensions for example.

Thank you in advance [smile2]

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.BlockStyler
Imports NXOpen.UF
Module NXJournal
Sub Main
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim theSession As Session = Session.GetSession()
Dim theUI As NXOpen.UI = NXOpen.UI.GetUI()
Dim theLW As NXOpen.ListingWindow = theSession.ListingWindow()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim theNXMessageBox As NXMessageBox = theUI.NXMessageBox
Dim block1 As Features.Block = CType(workPart.Features.FindObject("BLOCK(1)"), Features.Block)

Dim block_found As Features.Block = block1
If block_found IsNot Nothing Then
theUI.NXMessageBox.Show("Track Block", NXMessageBox.DialogType.Information, "Block exists")
Else
theUI.NXMessageBox.Show("Track Block", NXMessageBox.DialogType.Information, "Block does not exists")
End If

End Sub
End Module
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top