IsIPartFactory and IsIPartMember

IsIPartFactory and IsIPartMember

oransen
Collaborator Collaborator
548 Views
2 Replies
Message 1 of 3

IsIPartFactory and IsIPartMember

oransen
Collaborator
Collaborator

If I put an iPart inside an assembly programatically (using Add to the occurences list) I get given a pointer to the part which I've just added.

 

I can see if this is an iPart by using these properties: IsIPartFactory and IsIPartMember, like this:

 

    if (pPartCompDef->IsiPartFactory == VARIANT_TRUE) {
        TRACE (L"InsertIpartInAssembly, %s is not ipart factory.",csIPartFullName); 
        return (E_FAIL) ;
    }

    if (pPartCompDef->IsiPartMember == VARIANT_TRUE) {
        TRACE ("This is an iPart member") ;

    } else {
        TRACE ("This NOT an iPart member") ;
    }

 

It seems that an "inserted" part says it is an IPartFactory as well as an IPartMember. In the case that both IsIPartFactory and IsIPartMember return VARIANT_TRUE  does that mean the object is in truth only an IPartMember?

 

Aplogies, my question is as clear as mud...!

 

 

 

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

philippe.leefsma
Alumni
Alumni
Accepted solution

The ComponentOccurrences.Add methods return a ComponentOccurrence object, not a pointer to a PartDocument.

 

On my side IsIPartFactory and IsIPartMember properties aren't both set to true at the same time.

 

If you provide a complete code sample, we can start looking into it...

 

Thank you.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 3 of 3

oransen
Collaborator
Collaborator

You are right. I had a senior moment, confusing C++ bool and COM VARIANT_TRUE

0 Likes