How to edit a part division

Hi! I need help to understend how to get to part division properties from given wall part. I have to set division part gap.

Here is what i came up with and stuck

:confused:

I understand this is an old post, but wondering if @Igor ever resolved this

Hi,
here an example how to get Material Part

import clr
import sys
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS

#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB

#import net library
from System import Array
from System.Collections.Generic import List, IList, Dictionary

#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument


def toList(x):
    if isinstance(x, list):
        return x
    elif hasattr(x, "GetType") and x.GetType().GetInterface("IEnumerable") is not None:
        return x
    else :
        return [x]

#Preparing input from dynamo to revit
lstelems = toList(UnwrapElement(IN[0]))
lstElemIds = List[ElementId]([x.Id for x in lstelems])

out_material = []
#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
if PartUtils.AreElementsValidForCreateParts(doc, lstElemIds):
    PartUtils.CreateParts(doc, lstElemIds)
doc.Regenerate()
for wall_Id in lstElemIds:
    temp = []
    partsIds = PartUtils.GetAssociatedParts(doc, wall_Id, True, True)
    for pId in partsIds:
        part = doc.GetElement(pId)
        matId = part.get_Parameter(BuiltInParameter.DPART_MATERIAL_ID_PARAM).AsElementId()
        temp.append(doc.GetElement(matId))
    out_material.append(temp)
TransactionManager.Instance.TransactionTaskDone()

OUT = out_material