×
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

How to check with a simple journal NX11 if the displayed part is a part family member ?

How to check with a simple journal NX11 if the displayed part is a part family member ?

How to check with a simple journal NX11 if the displayed part is a part family member ?

(OP)
Hi,

How to check with a simple journal NX11 if the displayed part is a part family member ?

Thanks in advance

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

Discarded...didn't read the question good enough :) :)

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX11 / TC11

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

CODE --> .net

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module NXJournal
Sub Main (ByVal args() As String)

Dim theSession As Session = Session.GetSession()
Dim theUI As UI = UI.GetUI()
Dim theUfSession As UFSession = UFSession.GetUFSession()


'Insert code here
        Dim dispPart As Part = theSession.Parts.Display
        Dim lw As ListingWindow = theSession.ListingWindow
        lw.Open()

        Dim is_family_template As Boolean
        theUfSession.Part.IsFamilyTemplate(dispPart.Tag, is_family_template)
        lw.WriteLine("Part Family Template: " & is_family_template.ToString())

        Dim is_family_instance As Boolean
        theUfSession.Part.IsFamilyInstance(dispPart.Tag, is_family_instance)
        lw.WriteLine("Part Family Instance: " & is_family_instance.ToString())




End Sub
End Module 

Suresh
www.technisites.com.au

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

(OP)
Hi Suresh,

Thanks a lot.

In fact I was looking for the work part instead of displayed part but I was able to edit the journal


Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module NXJournal
Sub Main (ByVal args() As String)

Dim theSession As Session = Session.GetSession()
Dim theUI As UI = UI.GetUI()
Dim theUfSession As UFSession = UFSession.GetUFSession()


'Insert code here
Dim workPart As Part = theSession.Parts.Work
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()

Dim is_family_template As Boolean
theUfSession.Part.IsFamilyTemplate(workPart.Tag, is_family_template)
lw.WriteLine("Part Family Template: " & is_family_template.ToString())

Dim is_family_instance As Boolean
theUfSession.Part.IsFamilyInstance(workPart.Tag, is_family_instance)
lw.WriteLine("Part Family Instance: " & is_family_instance.ToString())




End Sub
End Module

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

Where /what is the requirement ?

The simplest way of seeing if a component is a part family member, is :


Then , when i see the above, I RMB the component - Properties - Parameters - Part Family - Information.

Regards,
Tomas

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

(OP)
Hi Tomas,
I need to developp a journal to save as all Sub assy and all components except of family member.

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

That's pretty close to what the Clone assembly does.

Regards,
Tomas

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

(OP)
Hi Tomas
Unfortunatly no.
Did you try with member family inside your assemby ?
Those parts are lost during clone opération :(

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

With /without Teamcenter ?

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

Quote (Didier)

Hi Tomas
Unfortunatly no.
Did you try with member family inside your assemby ?
Those parts are lost during clone opération :(

That is a setting in the teamcenter integration preferences if I'm correct (if you are working in Teamcenter)

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX11 / TC11

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

(OP)
Hi
I am talking without Teamcenter, but I will have a look with Teamcenter to check

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

(OP)
Hi,

I have modified my journal to scan the assembly but the result is not correct: Family member are not recognized mad

Find herewith an assembly for test

Thanks in advance for your help

_____________________________________________________
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.Assemblies
Imports NXOpen.Features
Imports System.Windows.Forms
Imports NXOpen.UF
Imports NXOpen.Utilities
Imports System.Collections.Generic

Module Main
Dim s As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim lw As ListingWindow = s.ListingWindow
Dim NXMessageBox As NXMessageBox = NXOpen.UI.GetUI().NXMessageBox
Dim Folder As String = Nothing
Dim workPart As Part = s.Parts.Work
Dim PartList As List(Of Part) = New List(Of Part)
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim loadStatus As PartLoadStatus = Nothing
Dim is_family_instance As Boolean

Sub Main()

Dim basePart As BasePart = s.Parts.BaseWork

If basePart Is Nothing Then
NXMessageBox.Show("", NXMessageBox.DialogType.Error, "No Work Part")
Return
End If

Do_The_Job()

End Sub
Sub Do_The_Job()

Dim dp As Part = s.Parts.Display

Dim c As ComponentAssembly = s.Parts.Display.ComponentAssembly
Scan(c.RootComponent, 0)

' Ajout la tête d'assemblage ou la part unitaire dans la liste à traiter (version 1.1)
If Not PartList.Contains(dp) Then PartList.Add(dp)

ufs.Ui.SetStatus("Nombre de parts trouvées= " & PartList.Count)

For Each part As Part In PartList
'Echo(vbCrLf & "Traitement de : " & part.FullPath)
'Echo("")
s.Parts.SetDisplay(part, False, True, loadStatus)

' ----------------------------------------------
' Test si c'est un membre de famille
' ----------------------------------------------

theUfSession.Part.IsFamilyInstance(workPart.Tag, is_family_instance)


If is_family_instance.ToString()=False Then

lw.WriteLine("La part " & s.Parts.Work.Leaf & " n'est pas un membre de famille")
Else
lw.WriteLine("La part " & s.Parts.Work.Leaf & " est un membre de famille")
End If
Next

' remet la tete d'assemblage en display part
s.Parts.SetDisplay(dp, False, True, loadStatus)

End Sub

Public Sub Scan(ByVal component As Component, ByVal niveau As Integer)
' ce sous-programme scanne récursivement l'assemblage
' il ne met pas dans la liste , les parts supprimées et non ouvertes
Try
Dim part As Part = CType(component.Prototype, Part)
Dim enfants As Component() = component.GetChildren()

If Not PartList.Contains(part) Then
PartList.Add(part)
For Each comp As Component In enfants
Scan(comp, niveau + 1)
Next
End If
Catch ex As Exception

End Try
End Sub

Public Sub Echo(ByVal output As String)
lw.Open()
lw.WriteLine(output)
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
End Function
End Module
______________________________________________________________________________



Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

In the following line

theUfSession.Part.IsFamilyInstance(workPart.Tag, is_family_instance)

workPart.Tag should be part.Tag

Also, make sure you open the listing window before writing to it.

Suresh
www.technisites.com.au

RE: How to check with a simple journal NX11 if the displayed part is a part family member ?

(OP)
Hi Suresh,

Thanks a lot

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

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