Folder Structure for Macros?

Need help, or want to share a macro? Post here!
User avatar
chennes
Veteran
Posts: 2168
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Folder Structure for Macros?

Post by chennes »

chrisb wrote: Sat May 14, 2022 11:28 pm If there would be a parameter controlling in/exclusion of subdirectories would be of further help.
Yes: once we have stopped hardcoding the path to user macros, I definitely imagine there being several ways to set which directories to look in.
Chris Hennes
Pioneer Library System
User avatar
johnwang
Veteran
Posts: 1072
Joined: Sun Jan 27, 2019 12:41 am

Re: Folder Structure for Macros?

Post by johnwang »

the code is at here:
https://github.com/FreeCAD/FreeCAD/blob ... mp.cpp#L78
What it does is:
1. retrieve the macro path from parameter or use the user data as default
2. Fill the List box

The list is not needed. Better change to just browse to select a file. Then do whatever one want.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
bavariaSHAPE
Posts: 395
Joined: Tue Jun 10, 2014 8:31 am

Re: Folder Structure for Macros?

Post by bavariaSHAPE »

chennes wrote: Sun May 15, 2022 2:48 pm
chrisb wrote: Sat May 14, 2022 11:28 pm If there would be a parameter controlling in/exclusion of subdirectories would be of further help.
Yes: once we have stopped hardcoding the path to user macros, I definitely imagine there being several ways to set which directories to look in.
What @chrisb writes would be a real simplification for macro management. Running macros from any folder without having to remember the path of the previous folder would be a relief for everyone. The current path specification (e.g. ...AppData/Roaming on Windows) is hard to follow for many users.
… meine zwei Cents für eine glückliche FreeCAD-Welt … just my two cents for a happy FreeCAD-World
User avatar
KurtF
Posts: 157
Joined: Fri Mar 04, 2022 7:36 pm
Location: North Carolina, US
Contact:

Re: Folder Structure for Macros?

Post by KurtF »

bavariaSHAPE wrote: Tue May 24, 2022 9:51 am What @chrisb writes would be a real simplification for macro management.
Agreed. After reading this post, I started working on packaging for a macro I'm developing. I chose to use a subfolder under .../Macro to hold class files, icon files, and thread standard lookup tables, keeping the FCMacro files in /Macro. This worked great except for one hard stop... I can't load the class file from subfolder into Macro Editor to work on it.
May whatever Higher Power you believe in bless the Ukrainians. They are a decent people who never hurt anybody.
edwilliams16
Veteran
Posts: 1223
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Folder Structure for Macros?

Post by edwilliams16 »

Another minor annoyance:
The Macro directory finds its way onto the directory history for Save and Save As so I end up accidentally writing FCStd files to the Macro Directory.
TheMarkster
Veteran
Posts: 4495
Joined: Thu Apr 05, 2018 1:53 am

Re: Folder Structure for Macros?

Post by TheMarkster »

KurtF wrote: Thu May 26, 2022 4:24 pm
bavariaSHAPE wrote: Tue May 24, 2022 9:51 am What @chrisb writes would be a real simplification for macro management.
Agreed. After reading this post, I started working on packaging for a macro I'm developing. I chose to use a subfolder under .../Macro to hold class files, icon files, and thread standard lookup tables, keeping the FCMacro files in /Macro. This worked great except for one hard stop... I can't load the class file from subfolder into Macro Editor to work on it.
You should be able to open from the File -> Open menu.
Post Reply