Cancel
Showing results for 
Search instead for 
Did you mean: 

Different part families instances from code

Valued Contributor
Valued Contributor

I'd like to have a subpart calculated by formulas with multiple part families instances in it.

I know I need to specify Valid Part Families but when I set quantity >1 all instances are created using part family defined in "Optimal part family" field.

 

Is it possible to drive instance of part family to be used for specified for each subpart member?

 

I know workaround - I can create subpart with quantity = 0 and then use Subpart.AddPart in i.e. AfterLoad event to fill subpart with instances of part family but maybe there is more simple way?

Maybe it's possible to somehow control "Optimal part family" ?

3 REPLIES

Betreff: Different part families instances from code

Siemens Genius Siemens Genius
Siemens Genius

Hi,

 

yes this is possible ... just put a String Porperty in your OptimalPartfamily and seperate the instances by comma

 

e.g.

In case you said the quantity is 10  ... then you have in the optimal partfamily:

 

Result = "pf1,pf4,pf2,pf1,pf1,pf8,pf7,pf8,pf9,pf1"

 

I would recomend to build this string somewhere else ... this works fine and all partfamilies are diffrent below that subpart collection

 

I hope that helps

Betreff: Different part families instances from code

Valued Contributor
Valued Contributor

Thanks a lot!
I didn't thought about having a list...
In my case I need one instance of each part family from subpart valid partfamilies so I can make a list of valid part families...
I'll check it tomorrow...

 

UPDATE:

Works like a charm! Thanks again!

Betreff: Different part families instances from code

Siemens Genius Siemens Genius
Siemens Genius

You can also just enter them into the Result of the optimal Partfamily

 

e.g. you have quantity 4

 

The Formula in Optimal Partfamily would look like this

 

Result = "Partfamily1, Partfamily2, Partfamily3, Partfamily4"

 

here an example

 2018-03-05 07_28_54-DesignRevision und PartRevision In RS - OneNote.png