Scripted Objects - List of Length Property?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
paullee
Veteran
Posts: 5136
Joined: Wed May 04, 2016 3:58 pm

Scripted Objects - List of Length Property?

Post by paullee »

Hi, I am attempt to tweak the ArchStairs.py code (discussion in Arch board), now trying to add variable width, railing...if possible...

The original code has following, and I try to make it into a list of Length to control different 'segment' of the stairs. Seem nothing in the https://www.freecadweb.org/wiki/Scripted_objects

Code: Select all

obj.addProperty("App::PropertyLength","Width","Arch",QT_TRANSLATE_NOOP("App::Property","The width of these stairs"))
The best seems to be App::PropertyFloatList.


Any better ideas?

Thanks.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Scripted Objects - List of Length Property?

Post by yorik »

Indeed there is no PropertyLengthList... We could add it, though. But I don't know how best to implement an editor for it (= what appears in the properties list and how to edit it)

In the meantime indeed your best choice is probably to use propertyFloatList. It should be easy to update when we have something better
paullee
Veteran
Posts: 5136
Joined: Wed May 04, 2016 3:58 pm

Re: Scripted Objects - List of Length Property?

Post by paullee »

yorik wrote: Thu Jul 12, 2018 12:51 am Indeed there is no PropertyLengthList... We could add it, though. But I don't know how best to implement an editor for it (= what appears in the properties list and how to edit it)

In the meantime indeed your best choice is probably to use propertyFloatList. It should be easy to update when we have something better
Thanks! Okay, may try this first until LengthList is available.
paullee
Veteran
Posts: 5136
Joined: Wed May 04, 2016 3:58 pm

Re: Scripted Objects - List of Length Property?

Post by paullee »

yorik wrote: Thu Jul 12, 2018 12:51 am Indeed there is no PropertyLengthList... We could add it, though. But I don't know how best to implement an editor for it (= what appears in the properties list and how to edit it)

In the meantime indeed your best choice is probably to use propertyFloatList. It should be easy to update when we have something better
Hi, I used propertyFloatList to add a new property to control different width in 'multi-edges' landing in ArchStairs ... but it is rather clumsy.

To avoid disturbing the original Width property, I keep it, and add 'Width of Landing'...

https://forum.freecadweb.org/viewtopic. ... 80#p257963


It is no hurry, just be great it seems if one day PropertyLengthList could be added.

Cheers
Post Reply