Get ProCurvedata from sketch geometry
Hi All,
I'm trying to get geometry parameters from sketch inside the Part (like this:)

I'm doing this in following way:
ProError GeomDataExporter::GetModelGeometry(const ProSolid& solid)
{
ProError status{};
ProGeomitem* itemsOut = nullptr;
ProFeature* features = nullptr;
status = GeomDataExporter::GetAllFeatures(solid, &features);
int featuresSize{};
status = ProArraySizeGet(features, &featuresSize);
for (int i = 0; i < featuresSize; i++)
{
ProCurvedata* items = nullptr;
status = ProFeatureGeomitemVisit(&features[i], ProType::PRO_CURVE, GeomVisitAction, nullptr, items);
int featuresSize{};
status = ProArraySizeGet((ProArray*)items, &featuresSize);
if (status != PRO_TK_NO_ERROR)
return status;
}
}
ProError GeomDataExporter::GetAllFeatures(const ProSolid& solid, ProFeature** features)
{
if (features == nullptr)
return PRO_TK_INVALID_PTR;
ProError status{};
status = ProArrayAlloc(0, sizeof(ProFeature), 1, (ProArray*)features);
if (status != PRO_TK_NO_ERROR)
return status;
status = ProSolidFeatVisit(solid, FeatureVisitAction, FeatureFilter, features);
if (status != PRO_TK_NO_ERROR)
ProArrayFree((ProArray*)features);
return status;
}
ProError GeomDataExporter::GeomVisitAction(ProGeomitem* p_geomitem, ProError err, ProAppData app_data)
{
ProError status;
ProGeomitemdata* curveItemData = nullptr;
ProCurvedata* curveData = nullptr;
ProCurve curve;
if (app_data == NULL)
return PRO_TK_BAD_INPUTS;
status = PRO_TK_NO_ERROR;
if (status == PRO_TK_NO_ERROR)
status = ProGeomitemToCurve(p_geomitem, &curve);
if (status == PRO_TK_NO_ERROR)
status = ProCurveDataGet(curve, &curveItemData);
if (status == PRO_TK_NO_ERROR)
curveData = curveItemData->data.p_curve_data;
if (status == PRO_TK_NO_ERROR)
{
status = ProArrayObjectAdd((ProArray*)&curveData,
PRO_VALUE_UNUSED, 1, &app_data);
}
return status;
}
In two words, I'm starting Solid feature visit and then for each feature I'm starting geomitem feature visit with hope to convert geom item to ProCurve and then get ProCurvedata. BUT when I run my code for sketch above, I'm getting 5 features but only one of that features is PRO_FEAT_CURVE. When I'm trying to get geom item for each feature - 4 of the is PRO_FEAT_CSYS and only one is PRO_CURVE. And that one PRO_CURVE returns PRO_TK_NOT_IMPLEMENTED when I'm calling ProGeomitemToCurve which means that this curve is composite.
I have a feel that I'm doing something wrong OR API do not designed to get geometry data from sketch.
If somebody had some similar issue or know some another way to do what I want, please help.
IN conclusion I want to get for circle the coordinates of center and the radius , for each line the start point and end point, and the corresponding data for the curve.

