cancel
Showing results for 
Search instead for 
Did you mean: 

Memory management in CAM

Hello all, 

 

I hope I can explain this clearly. I am writing some codes to generate "GENERIC_MOTION" operation that contains a series of point-to-point sub-opr for CAM.

 

Basically, there is a UI, asking for some parameters and based on which, some points are created (by the "CreatePoint" method). Then, once "OK" is clicked, it will start looping and call a point-to-point subop API on each of those created points.  The output of the program is a "GENERIC_MOTION" operation on the Operation Navigator Tree.

 

I am confused about the following:

 

In the case where the user creates a generic_motion operation by using the application and then deletes this operation on the tree,  what happens to those points the application created? Are those points still going to reside in NX? 

 

 

Thanks in advance.

 

Steph

7 REPLIES

Re: Method of Memory management in CAM

I am going to answer this myself. Please correct me, if I have anything wrong.

 

After a series of trying to print the tags of the objects and get the tag of the objects, I believe the followings:

 

1) To answer the question, if I create points for p2p sub-operations and later delete the operation itself. Those points WILL still reside in NX.

 

2) The behaviour of the ootb interactive "add subop" function:  If I used the

If I used the ootb p2p sub-operation to create the operation interactively, I will still have to specify points. Those specified points WILL still reside in NX if I delete the operation. 

 

3) The behavior of the OOTB interactive "specifying clearance plane"

The same case for specifying a clearance plane. I did the following test:

go to MCS-> Clearance-> Clearance Option -> Specify Plane,  select a plane and offset it by 10 mm, click OK.

A new plane will be created in NX. Now if I reopen the dialog, and change the offset value and click Ok again, another new plane will be created, while the old plane is still there.

Now if I reopen the dialog, and change the offset value and click Ok again, internally another new plane will be created, while the old plane is still there.

 

 

All this means that, at least in NX ootb applications, every time we use "Specify Plane" or "Specify Points"... to change the clearance plane or specify something with an offset, we are creating one new object that will stay in NX forever. So if we change the variables used in "specify plane/point", interactively, we are creating a new object and the old will not be deleted and we almost have no access to this "dangling" old object.

Re: Method of Memory management in CAM

Siemens Phenom Siemens Phenom
Siemens Phenom

 

You can create points in different ways with CreatePoint, and the way the point is created may have an effect on the way it behaves.  Is the point associative?  Is it a "smart" point?

 

Did you set the visibility so that you can see the point?

 

If you make it visible, and if nothing is depending on it, then you can easily select it for deletion.

 

If you are creating "smart" points, and if they are not visible, then by default they should be created in the condemned state.  The documentation says that "Condemned objects will be deleted when their references go away."

Re: Method of Memory management in CAM

Honored Contributor
Honored Contributor

SteveLabout wrote:

 

You can create points in different ways with CreatePoint, and the way the point is created may have an effect on the way it behaves.  Is the point associative?  Is it a "smart" point?

 

Did you set the visibility so that you can see the point?

 

If you make it visible, and if nothing is depending on it, then you can easily select it for deletion.

 

If you are creating "smart" points, and if they are not visible, then by default they should be created in the condemned state.  The documentation says that "Condemned objects will be deleted when their references go away."


And if for some odd reason the condemned object hangs around in the file, you can get rid of it with the part cleanup option: "delete unused objects".

Re: Method of Memory management in CAM

Hi Steve

 

The points are created by CreatePoint(Point3D pt3D). But I set it as invisible though. Does this mean it is in the condemned state?

Re: Method of Memory management in CAM

Siemens Phenom Siemens Phenom
Siemens Phenom

 

I believe the Point3d overload of CreatePoint() yields a "dumb" point, which you will need to explicitly delete once you are finished with it.  You can check one to be certain by passing the tag of the point into the wrapper for UF_SO_is_so().

 

 

 

Re: Method of Memory management in CAM

Honored Contributor
Honored Contributor

You can use the .AskStatus method to find if the object is in the condemned state or not.

 

Also, to add to my previous post, you can delete condemned objects with the .DeleteNonDeletables method. I've not tested it, but it looks like the API equivalent of the part cleanup option mentioned previously.

Re: Method of Memory management in CAM

Siemens Phenom Siemens Phenom
Siemens Phenom

 

And now I also feel the need to add a footnote to my earlier post.  The note in the docs that I cited earlier only applies to condemned objects that are also smart objects.  It is possible for non-smart objects to be condemned, in which case, they can hang around a long time.  Also, we have seen cases where a user had specified to use a particular reference set, and CreatePoint() added the created points to the reference set.  Once that happens, even if no other geometry is depending on them, they still have an active reference, as a member of the reference set, and whether they are smart or not, NX is going to hold onto them unless you or someone else takes action to get rid of them.