i need some Help with Wrapper Functions.
i want to use a Wrapper Function from NXOpen.UF.UFSo --> AskParents()
in The Documentation they say that to use a wrapper Function you have to create an instance of the UFSession.
So what i did is :
TheUFSession = UFSession.GetUFSession();
is that right ?
And how can i use the wrapper Function ?
what i Did is :
public NXOpen.UF.UFSo Ask_Parents;
But i get always an error message because my Ask_Parents is null :/
Maybe somebody can help me
Thank you very much in advance.
Solved! Go to Solution.
Once you have the UfSession initialized, you can use it like this:
The wrapped functions are grouped by category:
TheUFSession.Modl = modeling functions
TheUFSession.Assem = assembly functions
TheUFSession.Draw = drafting functions
That error means that the object you passed in to the function is not a 'smart object' and the .AskParents function can't do anything useful with it.
I have a list of Feature Tags, and i'm passing one Tag (FeatureTag) to the AskParents Method.
And now i want to get all Parents of the Feature and list them.
The Object is only a curve. And this Curve has a lot of Parents. And i want to select all Parents.
TheUFSession.So.AskParents(FeatureTag, NXOpen.UF.UFConstants.UF_SO_ASK_ALL_PARENTS, out n_parents, out ParentTag)
Like Steve said, not all objects are 'smart'. Open a model in NX and create a point in space (turn off the 'associative' option). No matter what happens to the model, the point stays put until you move or delete it. Create another point, turn the 'associative' option on this time and pick an end point of a model edge. Now when the model updates, the point updates with it. NX has created an associativity between the edge end point and the point object; the point is a smart object and the edge is one of its parents. The first point is just hanging out in space, it is a 'dumb' point.