Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

CaeGroup of ElementFaces

Creator
Creator

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?

3 REPLIES 3

Re: CaeGroup of ElementFaces

Looking at the NX11 refs for that function, I see a different signature, namely

 

CreateGroup(setName, objects)

 

https://docs.plm.automation.siemens.com/data_services/resources/nx/11/nx_api/custom/en_US/nxopen_pyt...

 

Not sure why the journal would record it with a "1" in between, but I'd try without that.

Nikolas Losse | Developer | Siemens PG PR R&D TEC
NX12 | CentOS7 | Python

Re: CaeGroup of ElementFaces

Siemens Phenom Siemens Phenom
Siemens Phenom

That signature is an overload added in NX 12 to allow the group label to be specified.

 

https://docs.plm.automation.siemens.com/data_services/resources/nx/12/nx_api/custom/en_US/nxopen_pyt...

 

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.

Re: CaeGroup of ElementFaces

Creator
Creator

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.