cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Datum attachement location returns (0, 0, 0).

DO_1054494
7-Bedrock

Datum attachement location returns (0, 0, 0).

Hello.

 

I am using Pro/TOOLKIT to connect to a Creo 8.0.5.0 session and to explore the active opened CAD file.

 

First of all, I need to retrieve the datum tags.

 

Here there is a skeleton of my program to do that.

 

ProEngineerConnect() ;

ProMdlCurrentGet() ;

ProMdlNameGet() ;

ProMdlTypeGet() ;

ProSolidSetdatumtagVisit(ProSetDatumTagVisitAction) ;

 

static ProError ProSetDatumTagVisitAction(ProSetDatumTag* pSetDatumTag, ProError, ProAppData    AppData)

{

// Obtention du label du datum tag.

  ProSetdatumtagLabelGet() ;

 

// Recherche des liens vers la géométrie à partir des références.

//

ProAnnotationReference*                         References(nullptr);

 

if (ProSetdatumtagReferencesGet(pSetDatumTag, &References) == PRO_TK_NO_ERROR)

{

     int ReferencesCount(0);

 

      if (ProArraySizeGet(References, &ReferencesCount) == PRO_TK_NO_ERROR)

      {

         for (int i = 0; i < ReferencesCount; i++)

         {

            switch (References[i].type)

            {

               case PRO_ANNOT_REF_SINGLE:

               {

                  ProSelection Selection(nullptr);

                  ProModelitem ModelItem = { PRO_TYPE_UNUSED, 0, nullptr };

 

                  if (ProReferenceToSelection(References[i].object.reference, &Selection) == PRO_TK_NO_ERROR &&

                      ProSelectionModelitemGet(Selection, &ModelItem)                     == PRO_TK_NO_ERROR)

                  {

 

                     switch (ModelItem.type)

                     {

                        case PRO_AXIS:

                        case PRO_SURFACE:

                        {

                                 Pro3dPnt           ptDatumFrameLocation;

                                 ProAnnotationPlane DatumFramePlane;

                                 ProPlanedata       DatumFramePlaneData;

                                 ProSelection       DatumAttachment(nullptr);

                                 Pro3dPnt           ptDatumAttachmentLocation;

 

                                 if ((ProSetdatumtagTextPointGet(pSetDatumTag, nullptr, nullptr, ptDatumFrameLocation) == PRO_TK_NO_ERROR || ProSetdatumtagTextLocationGet(pSetDatumTag, nullptr, ptDatumFrameLocation) == PRO_TK_NO_ERROR) &&

                                     ProSetdatumtagPlaneGet(pSetDatumTag, &DatumFramePlane)             == PRO_TK_NO_ERROR                                                                                                                  &&

                                     ProAnnotationplanePlaneGet(&DatumFramePlane, &DatumFramePlaneData) == PRO_TK_NO_ERROR                                                                                                                  &&

                                     ProSetdatumtagAttachmentGet(pSetDatumTag, &DatumAttachment)        == PRO_TK_NO_ERROR                                                                                                                  &&

                                     ProSelectionPoint3dGet(DatumAttachment, ptDatumAttachmentLocation) == PRO_TK_NO_ERROR)

                                 {

 

BUG ! ->                       ptDatumAttachmentLocation == {0, 0, 0} !!!!

 

If the datum tag is connected to a geometrical tolerance, the datum tag attachement location returned by Pro/TOOLKIT is null !

 

For more informations, you can refer to the following case which has been opened for this problem :

 

https://www.ptc.com/appserver/cs/view/case.jsp?n=16437645

 

Is it possible to have a correction for this problem ?

 

Thank you.

 

Best regards.

 

0 REPLIES 0
Top Tags