Hello all,
I'm taking my first steps into NX Open using c# and have the following problem...
From an assembly I am able to produce a list of the child components...However it is returning a list of ALL the components in the Assembly.
I would like to see only the immidiate children (sub assemblies toplevels)...
What Ihave so far is;
How to proceed?
Ronald van den Broek
Application Specialist
Winterthur Gas & Diesel Ltd
NX8.5.3 / TC9.1.2
HPZ420 Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz, 32 Gb Win7 64B
Nvidea Quadro4000 2048MB DDR5
HP EliteBook 8570W Intel(R) Core(TM) I7-3740QM CPU @ 2.70GHz, 16Gb Win7 64B
I'm taking my first steps into NX Open using c# and have the following problem...
From an assembly I am able to produce a list of the child components...However it is returning a list of ALL the components in the Assembly.
I would like to see only the immidiate children (sub assemblies toplevels)...
What Ihave so far is;
Code:
//get all parts in session and create List
List<NXOpen.Part> newDisplayParts = new List<NXOpen.Part>();
foreach (NXOpen.Part part in theSession.Parts)
{
NXOpen.Assemblies.Component childComp = part.ComponentAssembly.RootComponent;
if (childComp != null)
{
foreach (NXOpen.Assemblies.Component comp in childComp.GetChildren())
{
//Checking if comp.protype is an actual NXOpen part is
if (comp.Prototype is NXOpen.Part)
{
theSession.ListingWindow.Open();
theSession.ListingWindow.WriteLine(comp.DisplayName);
NXOpen.Part prototype = (NXOpen.Part) comp.Prototype;
if (prototype == workPart)
{
newDisplayParts.Add(part);
}
}
}
}
}
How to proceed?
Ronald van den Broek
Application Specialist
Winterthur Gas & Diesel Ltd
NX8.5.3 / TC9.1.2
HPZ420 Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz, 32 Gb Win7 64B
Nvidea Quadro4000 2048MB DDR5
HP EliteBook 8570W Intel(R) Core(TM) I7-3740QM CPU @ 2.70GHz, 16Gb Win7 64B