×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NX open for feauture recognition

NX open for feauture recognition

NX open for feauture recognition

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources