I have a Block Styler object selection that allows me to select some element faces. I would like to put these selected element faces in to a group. The group gets created, however it does not contain the element faces - it is empty.
element_faces = self.selection0.GetSelectedObjects() group = self.workFemPart.CaeGroups.CreateGroup("element_faces ", 1, element_faces)
The group also does not appear in the Simulation Navigator/Groups. I can only see it if i right click - manage groups.
Manually creating a group of element faces works. The code in a recorded journal looks exactly the same.
Am i missing something?
Solved! Go to Solution.
Looking at the NX11 refs for that function, I see a different signature, namely
Not sure why the journal would record it with a "1" in between, but I'd try without that.
That signature is an overload added in NX 12 to allow the group label to be specified.
Note the requirements on the Label argument:
The group label must be >=0 and be unique
The code line shown has the label hard-coded to 1. If you are using this in a loop or if group 1 already exists, it may cause the issue you are seeing.
Note that removing the second argument will cause NX to use the next available label for the group.
That was it! Thanks.
Unfortunately the element faces are not displayable if the group gets highlighted...
But anyway, now i can at least create a group to persistently remember element faces.