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


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

here an example how to get Material Part

import clr
import sys
import System
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS

#import Revit API
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)
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
if PartUtils.AreElementsValidForCreateParts(doc, lstElemIds):
    PartUtils.CreateParts(doc, lstElemIds)
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()

OUT = out_material