Page 1 of 1

SOLVED: Access all properties with same 'Group'(?)

Posted: Wed Jun 29, 2022 9:53 pm
by keithsloan52
Don't think Group is the right term but If an objects properties has been set with say

Code: Select all

obj = App.ActiveDocument.addObject("Part::Feature", "CustomObject")

obj.addProperty("App::PropertyFloat", "Velocity", "Parameter", "Body speed")
obj.addProperty("App::PropertyBool", "VelocityEnabled", "Parameter", "Enable body speed")
How can I scan just through all properties with 'Group'(?) "Parameter"

Re: Access all properties with same 'Group'(?)

Posted: Wed Jun 29, 2022 10:40 pm
by edwilliams16
Just looking at the available methods for obj

Code: Select all

for prop in obj.PropertiesList:
    if obj.getGroupOfProperty(prop) == 'Parameter':
        print(f'{prop} = {getattr(obj, prop)}')

Re: SOLVED: Access all properties with same 'Group'(?)

Posted: Thu Jun 30, 2022 6:12 am
by keithsloan52
Thanks