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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

visit datum plane

xd
1-Newbie
1-Newbie

visit datum plane

i'd like visit all datum plane that set the gtol datum property.

i visit the feature and check it's type PRO_FEAT_DATUM,

if true, visit it's geomitem

when i check is it a gtol datum, there came up to the PRO_TK_BAD_INPUTS error,  in the geomitem visit action (the gvAction),

in the debug,

the p_handle is PRO_SURFACE 199 , it's feature is PRO_FEATURE 198,

the feaure mdl name is DTM1, and the surface isDatumPlane is TRUE.

I believe it's true the surface is a Datum Plane,

why the call to ProGeomitemSetdutumGet is PRO_TK_BAD_INPUTS??

Please, please help.

//--------------------------------------------------------------------------------feature visit action

static ProError fvAction( ProFeature* p_feature, ProError status, ProAppData app_data )

{

  ProSolid solid;

  ProFeattype ftype;

  solid=(ProSolid)app_data;

  status=ProFeatureTypeGet(p_feature,&ftype);

  if (ftype==PRO_FEAT_DATUM)

  ProFeatureGeomitemVisit(p_feature,PRO_SURFACE,gvAction,NULL,(ProAppData)solid);

  status=PRO_TK_NO_ERROR;

  return status;

}

//--------------------------------------------------------------------------------geom visit action

static ProError gvAction (ProGeomitem *p_handle,ProError status, ProAppData  app_data )

{

  ProSolid solid;

  ProBoolean isgtd;

  ProGtolsetdatumValue gtdv;

  ProFeature feat;

  ProName name;

  ProCharName cname;

  ProSurface surface;

  ProBoolean isdatum;

  ProGeomitem gitem;

  solid=(ProSolid)app_data;

  status=ProGeomitemToSurface(p_handle,&surface);

  status=ProSurfaceIsDatumPlane(solid,surface,&isdatum);

  status=ProSurfaceToGeomitem(solid,surface,&gitem);

  status=ProGeomitemFeatureGet(p_handle,&feat);

  status=ProModelitemNameGet(&feat,name);

  ProWstringToString(cname,name);

  status=ProGeomitemSetdatumGet(p_handle,&isgtd,&gtdv);

  status=ProGeomitemSetdatumGet(&gitem,&isgtd,&gtdv);

  status=ProGeomitemSetdatumGet(&feat,&isgtd,&gtdv);

  if (isgtd==PRO_B_TRUE)

  {

  if (gtdv.type==PRO_GTOLREF_IN_GEOM) status=ProSelectionFree(&gtdv.ref.geom);

  ProMessageDisplay(MSGGOEMTOL,"XD geomtol %0s",cname);

  }

  status=PRO_TK_NO_ERROR;

  return status;

}

0 REPLIES 0
Top Tags