×
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 7.5 Journal - Determine Solid Body Material

NX 7.5 Journal - Determine Solid Body Material

NX 7.5 Journal - Determine Solid Body Material

(OP)
How do I determine the MATERIAL attribute assigned to a solid body using .NET Journal?

Thanks,
Jeff

RE: NX 7.5 Journal - Determine Solid Body Material

I know this is not the exact answer that you're looking for, but starting with NX 8.0 it will be as simple as reading the Material Object Attribute assigned to the Body. Now technically you can do that today with NX 7.5, but until NX 8.0 there was no way to be sure that this attribute was actually reporting the true material assignment since prior to NX 8.0 there was no way of preventing someone from either deleting this attribute or worse yet, editing it manually giving you the impression that the material assignment was something different than what it actually is. Starting with NX 8.0 both the Material Part and Object attributes, once a material has been properly assigned, will be stored as 'Read-Only' meaning that they cannot be changed by using without actually reassigning a different material. What this will mean is that doing something as simple as reading an attribute will all that will be needed to determine what materials have been assigned to which bodies in your Part File.

Now with NX 7.5 you can still take this approach, just that there will be guarantee that the attribute that read will be correct. Now if you're pretty sure that people have NOT been messing with these Material attribute values, you can go ahead and use this approach now.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.

RE: NX 7.5 Journal - Determine Solid Body Material

jmarkus,

Here is one possible .Net implementation of John's suggested approach for NX7.5. It reports the MATERIAL attribute for the selected object(s).

HTH, Joe

CODE

Option Strict Off
Imports System
Imports NXOpen

Module NXJournal

    Dim theSession As Session = Session.GetSession()

    Sub Echo(ByVal output As String)
        theSession.ListingWindow.Open()
        theSession.ListingWindow.WriteLine(output)
        theSession.LogFile.WriteLine(output)
    End Sub

    Sub ReportNXObjectAttributes(ByVal obj As NXObject)
        Dim mv As String = "unset"
        mv = obj.GetStringAttribute("MATERIAL")
        Echo ("Material = " + mv)

    End Sub

    Sub Main()

        Dim theSelection As Selection = UI.GetUI().SelectionManager
        For ii As Integer = 0 To theSelection.GetNumSelectedObjects() - 1
            ReportNXObjectAttributes(theSelection.GetSelectedTaggedObject(ii))
        Next

    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