Continue to Site

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!

Finding Underconstrained Int. Sketches Identified Using Checkmate (NX6

Status
Not open for further replies.

jcardw

Mechanical
May 17, 2011
2
Hi,

Longtime lurker, first time poster here with a NX question.

We are currently are trying to get a part to pass checkmate. Checkmate has identified a few sketches that are not fully constrained. I was able to locate all but 2 using information> expression> list by sketch.

Is there an easy way to search for which internal sketch is associated with which feature?

Thanks!
 
Replies continue below

Recommended for you

Thanks for the response John. Do you have any idea if this is something Siemens PLM is looking at?
 
It's been requested, but I'm not aware of any project currently underway to provide that sort of feedback.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
Below is a simple journal that lists sketch info. It may be a starting point to give you what you want.

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.Features

Module NXJournal
Sub Main()
Dim s As Session = Session.GetSession()
Dim ui As UI = ui.GetUI()
Dim lw As ListingWindow = s.ListingWindow
lw.Open()
For Each sk As Sketch In s.Parts.Work.Sketches
sk.Highlight()
lw.WriteLine(sk.Name & " (" & sk.ToString() & ")")
lw.WriteLine(" IsInternal: " & sk.IsInternal)
If sk.IsInternal = True Then
lw.WriteLine(" Parent(s)")
For Each feat As Feature In sk.Feature.GetParents
lw.WriteLine(" " & feat.GetFeatureName.ToString)
Next
End If
lw.WriteLine(" IsActive?: " & sk.IsActive)
lw.WriteLine(" IsBlanked?: " & sk.IsBlanked)
lw.WriteLine(" Color: " & sk.Color)
lw.WriteLine(" Layer: " & sk.Layer)
lw.WriteLine(" Font: " & sk.LineFont)
lw.WriteLine(" Width: " & sk.LineWidth)
lw.WriteLine(" Objects:")
Dim objects() As NXObject = sk.GetAllGeometry()
For Each obj As NXObject In objects
lw.WriteLine(" " & obj.Name)
Next
If sk.IsInternal = False And sk.IsBlanked = False Then
ui.NXMessageBox.Show("Information", _
NXMessageBox.DialogType.Information, _
"Sketch " & sk.Name & " is highlighted")
sk.Unhighlight()
ElseIf sk.IsBlanked = True Then
ui.NXMessageBox.Show("Information", _
NXMessageBox.DialogType.Information, _
"Sketch " & sk.Name & " is blanked")
ElseIf sk.IsInternal = True Then
ui.NXMessageBox.Show("Information", _
NXMessageBox.DialogType.Information, _
"Sketch " & sk.Name & " is internal")
End If
Next
End Sub
End Module

Hope this is of some help.

Frank Swinkels
 
A small addition to the previous journal to find the sketches that are not fully constrained. Each sketch must first be activated in turn. We can then get the number of degrees of freedom remaining. If the DOFs are > 0 then the sketch is not fully constrained. Finally we need to deactivate the sketch.

Dim dofs As Integer
Dim status1 As Sketch.Status
...
...
sk.Activate(Nothing)
status1 = sk.GetStatus(dofs)
If dofs > 0 Then
lw.WriteLine(sk.Name & " has " & dofs.ToString & _
" degrees of freedom")
End If
sk.Deactivate(Nothing, Nothing)

Hope this helps

Frank Swinkels
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor