I want to use ProNoteAttachAddend() API for making leader line to my note. For this Proselection object is required. I am able to create ProSelection object but not able to set selected id and type correctly to my proselection object.
ProSelction object can be created by using the item name and item type.
Make ProModelItem object first (using 'ProModelitemByNameInit'), and then create ProSelection object (using 'ProSelectionAlloc').
I am making a point programatically (so don't have name or id of this point) and select it as a proselection() object programatically.
How do you create the point programmatically? Could you post here a piece of code? It should be a modelitem, so you should be able to use it directly in ProSelectionAlloc..
It is not model item. Can you help me to make a point model item. I want to code it like this.
than use this point to make proselection object.
You can't create a point like this. If you want it selectable than it need to be a model item and this need to be inside Creo Features. The Only war I know is to create it as a feature.
Another way could be a mapkey. Thats no nice solution ... but sometimes the easiest way.
hi I have no Code for a point atm, but in this Thread is some code for a Datum Plane:
The creation is nearly same, just look wich element tree nodes you need. You could find them inside the API Documentation.
All suggested methods are good and to the point. But in my case i got one API ProGeometryAtPointFind() works really well. This API should be used when you are certain that your 3D point will be on the part surface somewhere.
This method will tell you surfaces or edges where the point lays on. I probably do not understand what are you exactly going to do...
See i need model item to fill proselection object and i already know that the co-ordinates which i have they are on part. So by using this API "ProGeometryAtPointFind" i get the proselection object at that point directly. It creates proselection object on that part with appropriate data structure.
extern ProError ProGeometryAtPointFind ( ProPart part,
Purpose: Determines the surfaces or edges on which the specified
point is located. If a point lies on an edge, the function
does not return the neighboring surfaces.
part - The part handle.
point - A three-dimensional point, in the coordinates of the part.
p_sel_arr - An array of <I>ProSelection</I>, which has information
about surfaces or edges on which the point is located.
The function allocates space for this array; free it
p_count - The number of items on which the point lies.
PRO_TK_NO_ERROR - The function successfully evaluated the point.
PRO_TK_BAD_INPUTS - One or more of the input arguments are invalid.
PRO_TK_E_NOT_FOUND - The surface or edge was not found.
Yes, but ProSelection of surface or edge(s). I thought you need ProSeleciton of point. But it does not matter, if this is what you need, it is fine.