[Solved] Is it possible create new Group and create parameter into Parameter editor from python?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

[Solved] Is it possible create new Group and create parameter into Parameter editor from python?

Post by Evgeniy »

Is it possible create new Group and create new parameter into new group in Parameter editor from python script?

I tell about this editor:

Image
Last edited by Evgeniy on Thu Sep 16, 2021 2:18 pm, edited 1 time in total.
chrisb
Veteran
Posts: 54164
Joined: Tue Mar 17, 2015 9:14 am

Re: Is it possible create new Group and create parameter into Parameter editor from python?

Post by chrisb »

Have a look at the Snip macro.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5512
Joined: Thu Apr 05, 2018 1:53 am

Re: Is it possible create new Group and create parameter into Parameter editor from python?

Post by TheMarkster »

Setting a parameter that does not exist causes it to be created, including the folder hierarchy.
mario52
Veteran
Posts: 4690
Joined: Wed May 16, 2012 2:13 pm

Re: Is it possible create new Group and create parameter into Parameter editor from python?

Post by mario52 »

Hi

Property

(example on my macro)

write

Code: Select all

__Title__  = "FCCircularText"
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetInt("seTtextAlignement", seTtextAlignement)    # 0, 1, 2
read

Code: Select all

__Title__  = "FCCircularText"
seTtextAlignement  = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetInt("seTtextAlignement")
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: Is it possible create new Group and create parameter into Parameter editor from python?

Post by Evgeniy »

Thanks for the detailed answers. Solved.
Post Reply