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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to create Visit Function for ProDrawingDimensionVisit()

KB_9753804
13-Aquamarine

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  

ACCEPTED SOLUTION

Accepted Solutions
FabianWolf
13-Aquamarine
(To:KB_9753804)

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

FabianWolf
13-Aquamarine
(To:KB_9753804)

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);

 

 

KB_9753804
13-Aquamarine
(To:FabianWolf)

Thank you

Announcements


Top Tags