How to get the number and individual objects of the members of a iPartFactory

How to get the number and individual objects of the members of a iPartFactory

Anonymous
Not applicable
291 Views
1 Reply
Message 1 of 2

How to get the number and individual objects of the members of a iPartFactory

Anonymous
Not applicable
Hi,

I have a Part which I converted into an iPartFactory, using the "Create iPart" options under the "Tools" menu. Now, programmatically, I get the PartComponentDefinition for this and query for whether this is a iPartFactory using the code below:

hr=((PartDocumentPtr)pCurrentDocument)->get_ComponentDefinition(&pComponentDef);
hr =pComponentDef->get_IsiPartFactory(&bIsFactory);

The above code is successful. Now I need additional info-, like to get the number of members in this part factory. But I dodnot find any API that gives me the number of members in this PartFactory. Additionally, I want to activate all the members of this IPartFactory one by one and then at the end re-activate the original member again.

As per my understanding there should be an API in the iPartFactory Object get the numbers of members and then to get all the "iPartMember" objects . But, I couldnot find such member functions. I feel my concept of factory and members is distorted here 🙂 Further, what is the signifacnce of "iPartMember" and "IsiPartMember" methods in the "PartComponentDefinition" object. This looks a bit weird to me.

Summarizing my problem:
1>how to get the number of members of Factory
2>how to get the individual members
3>how to activate a partical member

Any info- with this regard will set me on the correct path.

Regards,
Amol
0 Likes
292 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
The PartComponentDefinition.iPartFactory property returns an iPartFactory
object which you can use to query the rows and columns of the table. Note
that when you create the factory, the members (which are also part
documents) are not automatically generated. They are generated when (say)
you create an instance of a row in the factory in an assembly. So, each row
in the factory contains the details of a potential member. The rows of the
factory can be accessed using iPartFactory.TableRows

It is currently not possible to activate each row in the factory via the
API. However, you can use the Excel APIs to drive the factory. The
iPartFactory.ExcelWorkSheet provides access to the Excel spreadsheet. If you
change the spreadsheet via Excel APIs, save it and close it, the changes are
absorbed into Inventor.

When the members are generated from the rows in the factory (either when it
is used in an assembly or by using iPartFactory.CreateMember), a part
document is created to represent that member. The
PartComponentDefinition.IsiPartMember property will return True for such
documents and the PartComponentDefinition.iPartMember property provides
details of the member.

Sanjay-

wrote in message news:5035250@discussion.autodesk.com...
Hi,

I have a Part which I converted into an iPartFactory, using the "Create
iPart" options under the "Tools" menu. Now, programmatically, I get the
PartComponentDefinition for this and query for whether this is a
iPartFactory using the code below:

hr=((PartDocumentPtr)pCurrentDocument)->get_ComponentDefinition(&pComponentDef);
hr =pComponentDef->get_IsiPartFactory(&bIsFactory);

The above code is successful. Now I need additional info-, like to get the
number of members in this part factory. But I dodnot find any API that gives
me the number of members in this PartFactory. Additionally, I want to
activate all the members of this IPartFactory one by one and then at the end
re-activate the original member again.

As per my understanding there should be an API in the iPartFactory Object
get the numbers of members and then to get all the "iPartMember" objects .
But, I couldnot find such member functions. I feel my concept of factory and
members is distorted here 🙂 Further, what is the signifacnce of
"iPartMember" and "IsiPartMember" methods in the "PartComponentDefinition"
object. This looks a bit weird to me.

Summarizing my problem:
1>how to get the number of members of Factory
2>how to get the individual members
3>how to activate a partical member

Any info- with this regard will set me on the correct path.

Regards,
Amol
0 Likes