Programmatically create a Datum Point on flat Surface with Creo Parametric Toolkit
I have a plate with 6 flat surfaces. It was added to an assembly, and I need to create a Datum point on the front surface, with offset distances to 2 adjacent surfaces.
There's an example from protoolkit/UgGeneralPointCreate.c for creating a General Datum point at Intersection of Three Surfaces, which works great, except I need to locate this point on the front surface with offset to the left and bottom surfaces (edges will work too).
This example (point at Intersection of Three Surfaces) element tree looks like this:
I modified the tree to fit my need as (will be called “1st element tree” from below):
--PRO_E_DPOINT_POINT |--PRO_E_DPOINT_POINT_NAME |--PRO_E_DPOINT_PLA_CONSTRAINTS |--PRO_E_DPOINT_PLA_CONSTRAINT |--PRO_E_DPOINT_PLA_CONSTR_REF (Ref surface 1) |--PRO_E_DPOINT_PLA_CONSTR_TYPE (PRO_DTMPNT_CONSTR_TYPE_ON) |--PRO_E_DPOINT_PLA_CONSTR_VAL |--PRO_E_DPOINT_PLA_CONSTR_REF (surface 2 left of s1) |--PRO_E_DPOINT_PLA_CONSTR_TYPE (PRO_DTMPNT_CONSTR_TYPE_OFFSET) |--PRO_E_DPOINT_PLA_CONSTR_VAL (40.0 - front width is 100) |--PRO_E_DPOINT_PLA_CONSTR_REF (surface 3 bottom of s1) |--PRO_E_DPOINT_PLA_CONSTR_TYPE (PRO_DTMPNT_CONSTR_TYPE_OFFSET) |--PRO_E_DPOINT_PLA_CONSTR_VAL (80.0 - front length is 200)
By plugging this element tree, it created a red colored point in the Model tree panel. And there’s no such datum point exists in Assembly. Apparently there’s something missing. When I right click on this red point in Model tree and pick “Edit”, there’s no info about this point shown in the dialog.
Then I tried using this element tree structure partially with PRO_E_DPOINT_DIM_CONSTRAINT (will be called “2nd element tree” from below):