WorkPoint in arbitrary position in an assembly file?

WorkPoint in arbitrary position in an assembly file?

oransen
Collaborator Collaborator
520 Views
2 Replies
Message 1 of 3

WorkPoint in arbitrary position in an assembly file?

oransen
Collaborator
Collaborator

Even manually I'm not able to add a WorkPoint in an arbitrary position in an Assembly file, and not even on a Sketchpoint. But I noticed that the assembly document has a list of WorkPoints so I tried programatically adding a work point, but though there's no error return values the point does not seem to get added.

 

Is this possible either manually or programatically?

 

Here is the code:

 

    CComPtr<WorkPoints> pWorkPointsList ;
    hRes = pAssemblyCompDef->get_WorkPoints (&pWorkPointsList) ;
    if (FAILED(hRes) || (pWorkPointsList == nullptr)) {
        ShowCOMError (hRes,L"could not get workpoint list") ;
        return ;
    }

    CComPtr<Point> pPt; // Create a 3d point
    hRes = theApp.GetTransGeomPtr()->CreatePoint(0.5,0.5,0.0,&pPt);
    if (FAILED(hRes)) {
        ShowCOMError (hRes,L" CreatePoint failed") ;
        return ;
    }

    hRes = pWorkPointsList->AddFixed (pPt,TRUE) ;
    if (FAILED(hRes)) {
        ShowCOMError (hRes,L"AddDFixed failed") ;
        return ;
    }
 

0 Likes
Accepted solutions (1)
521 Views
2 Replies
Replies (2)
Message 2 of 3

wayne.brill
Collaborator
Collaborator
Accepted solution

Hi,

 

Can you try changing the Construction argument for AddFixed() to  False?

 

When the construction argument is True the WorkPoint is getting created but you just don't see it in the UI.  Please let me know if your results are different.

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

Message 3 of 3

oransen
Collaborator
Collaborator

Thanks! That did it!

0 Likes