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

How to create Visit Function for ProDrawingDimensionVisit()

KB_9753804
12-Amethyst

How to create Visit Function for ProDrawingDimensionVisit()

I am working on drafting , where I have to collect all dimension in drawing for this I used ProDrawingDimensionVisit() function but argument like visitAction & FilterAction need to pass Please help me to create dimension VisitAction Function  

1 ACCEPTED SOLUTION

Accepted Solutions

That's how your callback (visitaction) might look like: 

ProError CollectDrawingDimensions(
        ProDimension *dimension, ProError /*status*/, ProAppData data)
{
    static_cast<vector<ProDimension>*>(data)->push_back(*dimension);

    return PRO_TK_NO_ERROR;
}

Use it like this:

std::vector<ProDimension> vecDrwDimensions;
ProError err = ProDrawingDimensionVisit(
        Drawing,
        PRO_DIMENSION,
        CollectDrawingDimensions,
        NULL,
        (ProAppData)&vecDrwDimensions);

 

 

View solution in original post

4 REPLIES 4

...\Creo 8.0.0.0\Common Files\protoolkit\protk_appls\pt_examples\pt_dbase\TestDimension.c

That's how your callback (visitaction) might look like: 

ProError CollectDrawingDimensions(
        ProDimension *dimension, ProError /*status*/, ProAppData data)
{
    static_cast<vector<ProDimension>*>(data)->push_back(*dimension);

    return PRO_TK_NO_ERROR;
}

Use it like this:

std::vector<ProDimension> vecDrwDimensions;
ProError err = ProDrawingDimensionVisit(
        Drawing,
        PRO_DIMENSION,
        CollectDrawingDimensions,
        NULL,
        (ProAppData)&vecDrwDimensions);

 

 

Thank you

Announcements