Pyhton Script for

Hello everyone
I have written a python script in which I create several masses, of type Form. I would like to integrate an evolution into this code that will allow me to create a family for each mass created (i.e. for each iteration of my loop). I don’t know how to go about it. I’m not familiar with Dynamo’s native functions, but I’ve heard of FamilyType.ByGeometry. Is this the right choice? Or do you recommend another function?
I’d like to point out that I’m launching my python script from a conceptual mass family window.
I remain at your disposal for any further information.
Thank you

Translated with (free version)


give it a try

share your progress

# 🎯 copy/paste

I have this code. I want each of the mass to turn into a family of conceptual masses.

courbe = curve.copy()

liste_curve = lstChop(courbe,len(courbe)//2)
s = []
s = Form.ByLoftCrossSections(liste_curve)

for i in range(len(solide)):
    matos_name = lst_matos[i]
        matos = Material.ByName(matos_name)
        solide_elem = solide[i]
        solide_elem.SetParameterByName('Matériau', matos)
        matos = Material.ByName('Red')

OUT = solide