AddiPartMember

AddiPartMember

oransen
Collaborator Collaborator
463 Views
2 Replies
Message 1 of 3

AddiPartMember

oransen
Collaborator
Collaborator

In C++ can I use this function, using the key index Member string to select which row in the factory I want to insert?

 

In the docs all I see is

 

  1. Use an iPartTableRow (but no examples in C++).
  2. Use an index, this works but I need to know the index before using it.
  3. Use a set of parameters in a string (but "[Member=142314]" does not seem to work

Can I not simple use a string with the appropriate member?

 

 

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

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

If you can do it in other languages, you can do it in C++ as well.

Did you test things in VBA? That's the simplest/quickest way to check how things work.

 

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 3

oransen
Collaborator
Collaborator
Accepted solution

Ok, this works:

 

 

    CComPtr<TransientGeometry> pTransGeom = ...
    CComPtr<Matrix> pPosMatrix;
    pTransGeom->CreateMatrix(&pPosMatrix); // Defaults to 0 0 0

    CComPtr<ComponentOccurrence> pTroncOcc = nullptr ;
    CComBSTR bstrTronchettiFile (L"C:\\TEST\\TEST_IPART.ipt") ;
    CComBSTR bstrMember (L"30086486") ; // the Member value
    pOccurrencesList->AddiPartMember (bstrTronchettiFile,pPosMatrix,_variant_t(bstrMember),&pTroncOcc) ;

Either I've missed it but what seems to be missing in all the help files and examples is the fact that the penultimate parameter is (can be) the Member, pure and simple.

0 Likes