cancel
Showing results for 
Search instead for 
Did you mean: 

renumbering 'Mesh Control/Edge Density ID' in a fem - How to?

Phenom
Phenom

To all

 

After days of work on a fem I noticed that the auto-numbering used by NX for the Mesh Control/Edge Density (and for most "features") is a bit messy, see attached. As I cannot find a command to "re-number" the Mesh Control/edge density', some kind of "clean up", I am thinking of writing a small program to re-number them. This is purely cosmetic as I like to have things nicely and sequentialy numbered.

 

Having done a bit of searching in the doc I cannot find anything related to Mesh Control//Edge Density keyword(s). Recording a test journal shows nothing!

 

Any suggestion on the best way to proceed?

 

Thanks

Regards

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)
13 REPLIES

Re: renumbering 'Mesh Control/Edge Density ID' in a fem - How to?

Siemens Phenom Siemens Phenom
Siemens Phenom

NXOpen.CAE.EdgeDensity has no Label property. It does inherit a Name property from the NXObject class.

 

NXObjects have internal names and custom names. The internal name is auto generated at the time of creation and there is no API access to it. If you 'rename' an object on the navigator, you are really setting the custom name (Name property on the object).

 

To prevent every object in the collector from being named "Edge Density" by default, the internal name is augmented with an index at the time of creation. The only real purpose is so you can correlate an item in the navigator to a label in the graphics window.

 

Note that if you create an object, then query the Name property in the API, it will be empty. If you set the Name property in the API, that name will show up in the navigator in place of the internal name. This is the behavior for all NXObjects (mesh controls, polygon geometry, CAD parts and features, etc.).

 

So, what you need to do if you want these indicies compacted is to loop through all of the objects in the collection and set the Name property. Your application needs to build the new name using it's own counter.

 

Note that if you do all of this, there is no guarantee that the items in the navigator will be sorted the way you want (you can't rename everything, then sort by name).

Re: renumbering 'Mesh Control/Edge Density ID' in a fem - How to?

Phenom
Phenom

Thanks JimB for the clarification. I half supect it was the case

 

The obvious question is then where do I start to get all of the objects in the collection?

 

Looping through the collection and "renaming" each item with a counter should be easy (I thinkl!)

 

Thanks

Regards

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: renumbering 'Mesh Control/Edge Density ID' in a fem - How to?

Siemens Phenom Siemens Phenom
Siemens Phenom

FemPart.BaseFEModel.MeshControlCollection.ToArray()

 

Re: renumbering 'Mesh Control/Edge Density ID' in a fem - How to?

Phenom
Phenom

Thanks. Found the keyword in the manual

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: renumbering 'Mesh Control/Edge Density ID' in a fem - How to?

Phenom
Phenom

Note that JimB stated

If you set the Name property in the API, that name will show up in the
navigator in place of the internal name

This is true as long as the navigator is set to do that. To make sure, right click in a blank area of the Part Navigator and choose Properties. On the General tab look at "Name Display", it has 3 options:

  1. System and User
  2. System Only
  3. User Replaces System

Your custom names will only show if you choose option 1 or 3 and JimB's assumption is that option 3 is set.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: renumbering 'Mesh Control/Edge Density ID' in a fem - How to?

Siemens Phenom Siemens Phenom
Siemens Phenom

This is true on the part navigator.

 

There is no such setting on the Simulation Navigator. "User Replaces System" is the inherent behavior.

Re: renumbering 'Mesh Control/Edge Density ID' in a fem - How to?

Phenom
Phenom
Ah. Didn't know that, I don't use FEM myself.
Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: renumbering 'Mesh Control/Edge Density ID' in a fem - How to?

Phenom
Phenom

MeshControlCollection is not part of BaseFEModel !

 

trying something like that

 

Dim theBasePart As BasePart = theSession.Parts.BaseWork
Dim theFEMPart As CAE.FemPart = CType(theBasePart, CAE.FemPart)
Dim theFEModel As CAE.FEModel = CType(theFemPart.BaseFEModel(), CAE.FEModel)
Dim arrMeshDensityControl() As CAE.MeshControl= theFEModel.MeshControlCollection.ToArray()

 

may actually use a of List()

Dim MeshDensityControlList As New List(Of CAE.MeshControl)

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: renumbering 'Mesh Control/Edge Density ID' in a fem - How to?

Phenom
Phenom

I have tried all the permutation of FEModel or FEMPart to acess the MeshControlCollection() and none are regonised by NX! Any idea?

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)