Section Option of a COMP Custom Parameter with Script?

Hello,

I’m trying to make a section before a custom parameter using only code (I know how to do it using the Component Editor).

I managed to create all the parameters and even the read only option with a script but I’m stuck with the section before the Header.

Here is my code :

OP=op('base_section')

OP.destroyCustomPars()

newPage=OP.appendCustomPage('Test Page')
newToggle=newPage.appendToggle('Tooglelight',label='Light')
p=newToggle
p.readOnly=True
newFloat=newPage.appendFloat('Mathtest',label='Math',size=2)
p=newFloat[0]
p.default=15
p.val=p.default
p=newFloat[1]
p.default=30
p.val=p.default

newHeader=newPage.appendHeader('Header',label='Header test')
p=newHeader
###p.section=True
###OP.par.Header.section=True

Thank a lot by advance.

Here is my TD file :

Custom_Paramater_Section_with_code.toe (3.9 KB)

p.startSection = True

You were so close :slight_smile:

Thank you Ivan!

That was exactly what I was looking for (and yes I was so close, I was a bit frustrated because I was starting to understand how the par class worked but without this useful page :wink:)

The documentation page that you posted will also be very useful!
Thanks!