1. How to save custom infomation with parts(if possible with features of part)? The information should be persistant and should not be accessible & invisible to user. It should be editable later by program
Example: Hole in part has some specific information like tolerance source etc. That information needs to be saved in the hole feature. It should be later accessible to use like in drawing etc.
2. How to get feature object in drawingview? We need feature information like its position(like mid center of hole) and custom information which we stored before. We want to display this information using NX Ballon > Leader in drawing. Position of feature is needed to find optimum position of the Ballon.
3. How to place Ballon in nearby empty area of hole? Pointer to any available method or algorithm will be useful.
re: saving info
There is the "customer area" that you can write to in a part file. It is inaccessible and invisible to the user, but it isn't very flexible. Space is limited to a 132 character string.
You could use feature or object attributes to save the information. The info would not be "inaccessible and invisible", but users do not normally apply or edit such attributes so the information would likely remain unseen (such information is not shown by default in the NX GUI).
Thanks
Thanks NXJournaling.
I have applied your suggestion. It is not perfect solution for my need but it is sufficient.
Do you have any suggestion for Q2 and Q3?
It will be great if you share those.
re: feature location
2) Many features have a .Location property that will return the coordinates in absolute space. You could use this information along with the MapModelToDrawing method to locate the feature on the drawing.
3) I don't know of an easy, fool-proof way to do this but I have a few ideas that might be made to work.
Not able to find feature visibilty
Thanks NXJournaling.
I am able to map feature location with drawing location.
However, I am not able to find if features are visible in View or now. For example hole is visible in front view but now in top view. Then in case of top view, I do not know, how to check it the hole feature is visible or not.
I tried AskVisibleObjects() of view. This is sample code and its output.
Dim DispObjs() As DisplayableObject
DispObjs = member_view.AskVisibleObjects()
lw.WriteLine("visible objects count = " & UBound(DispObjs, 1) - LBound(DispObjs, 1) + 1)
For Each DispObj As DisplayableObject In DispObjs
lw.WriteLine("visible objects = " & DispObj.ToString())
Next
Output
visible objects count = 9
visible objects = Point 38828
visible objects = CartesianCoordinateSystem 39076
visible objects = Body 55962
visible objects = DatumAxis 38674
visible objects = DatumAxis 38673
visible objects = DatumAxis 38672
visible objects = DatumPlane 38667
visible objects = DatumPlane 38666
visible objects = DatumPlane 38665
There is no mention of hole feature. If you have any idea, then it will be great if you share with me.