GetAssociatedParts method /Getdepedentelements method


I want to retrieve the parts elements or the parts IDs from partmaker class.

I used a partdivide method and it returned a partmaker element, but I would need the parts it created or the ids of those parts.
Using GetAssocietedParts method
parts = PartUtils.GetAssociatedParts(doc, partmaker.Id, 1, 1)
The all trasaction


if PartUtils.AreElementsValidForCreateParts(doc, FloorList):
    	createParts = PartUtils.CreateParts(doc, FloorList)

    parts = PartUtils.GetAssociatedParts(doc, Floor.Id, 0, 0)
    partmaker = PartUtils.DivideParts(doc, parts, intersectionElementsIds, curveArray, sketchPlane.Id)

    parts = PartUtils.GetAssociatedParts(doc, partmaker.Id, 1, 1)


    OUT =[partDivide,parts]

i got a empty list I don´t know if this is possible.
Using GetAssocietedParts method

How can I create a filter to pass into the the getdependentelements method?

I have to create A IDisposable? sorry I don´t know a lot about .net framework.

Would appreciate some help on this.


Using GetAssocietedParts method doesn’t work because partmaker has no partassocieted


I got false

The get dependent elements method recives a filter

the element classfilter Constructor recives a type to do a filter of this type (I Think)

And to create this type I would need to import the type class (from .net?)

And I also have to put the return of the method in a IList

The ref would look something like this ?

from System.Collections.Generic import List
from System import Type

And the code would look something like this ?

Part_type=typeof(part)#making the part type
filter=ElementClassFilter(Part_type)#making the filter#making the filter
Part_List=List[ElementId]()#making the part list receiver
PartList.Add(GetDependentelElements(filter)) #getting parts ids 

If anyone could help, I would appreciate

Thank you very much !

Forgot to mention, I’ve noticed that sometimes the output list was giving the wrong results. Transaction.end did the trick.