EasyAlias macro
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
EasyAlias macro
Here is a macro to help ease the pain of creating spreadsheet aliases.
Usually when I setup a spreadsheet it looks something like this:
I'll have my labels in Column A and my values and aliases in Column B. The label in Column A is completely irrelevant to FreeCAD; all it cares about is the alias and content in Column B because I'll set my constraint in a sketch (or some property of an object) to something like Spreadsheet.radius (where radius is one of the Column B aliases). This works fine, but the only issue is it can be somewhat tedious and time-consuming (not to mention cumbersome, awkward, and aggravating) to setup the aliases. It occurred to me the string I use for my Column A label will almost always make a suitable alias for the cell in Column B, so why not automate the process to use that label for the alias? Why not, indeed.
Here is a screencast:
Usually when I setup a spreadsheet it looks something like this:
I'll have my labels in Column A and my values and aliases in Column B. The label in Column A is completely irrelevant to FreeCAD; all it cares about is the alias and content in Column B because I'll set my constraint in a sketch (or some property of an object) to something like Spreadsheet.radius (where radius is one of the Column B aliases). This works fine, but the only issue is it can be somewhat tedious and time-consuming (not to mention cumbersome, awkward, and aggravating) to setup the aliases. It occurred to me the string I use for my Column A label will almost always make a suitable alias for the cell in Column B, so why not automate the process to use that label for the alias? Why not, indeed.
Here is a screencast:
- Attachments
-
- EasyAlias.FCMacro.py
- (4 KiB) Downloaded 652 times
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: EasyAlias macro
sounds similar to this: Macro_Alias_Manager
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: EasyAlias macro
Thanks for the link. Yes, that macro is similar to this one. But...
While there are similarities between the two macros I think the developers' goals are different. I can't read minds, but I know what my goals were for making Easy Alias -- to streamline the workflow required for setting aliases. Based on my examination of Alias Manager, I believe the developers' goals were different -- to make a comprehensive alias management tool, with which the user can set aliases, clear aliases, move aliases, etc. AM's advantages include a graphical user interface and a more comprehensive feature list. EA's advantages include a more streamlined workflow, and, it's also a little bit more robust in the types of labels from which it can successfully generate aliases (those labels containing spaces). I believe it would be reasonable to install and use both macros, depending on the needs at the time. For example, if you have aliases you wish to clear or move to another column, Alias Manager would be the tool for that job, but if you just want to quickly generate aliases, Easy Alias is the tool to use.
Re: EasyAlias macro
Who wants to have two macros for maintaining aliases? I would appreciate it if you contact the authors and if you create a single macro with the best of both .TheMarkster wrote: ↑Mon Aug 20, 2018 6:41 pm I believe it would be reasonable to install and use both macros, depending on the needs at the time.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: EasyAlias macro
Thank you for this macro. Works great and does what I needed. Coming from F360 I use parameters all the time so this really accelerates the process of creating variables.
v0.19
v0.19
- ChristophS
- Posts: 8
- Joined: Tue Apr 20, 2021 8:42 pm
- Location: Aachen
Re: EasyAlias macro
Thank you! A very useful macro!
-
- Posts: 161
- Joined: Mon Feb 01, 2021 7:22 pm
Re: EasyAlias macro
Great macro! I think it should be a built in tool, called something like ("Cell contents to cell on the right alias"). Everyone deals with this issue.
Re: EasyAlias macro
I use the column to the left as a description. For this to be useful for me I'd have to type a second column with the alias anyhow.
But I like macros...that's the point of user extensible software.
So, great job!
But I like macros...that's the point of user extensible software.
So, great job!
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
- xsuper9988
- Posts: 223
- Joined: Sat Oct 24, 2020 4:20 am
Re: EasyAlias macro
Sorry can you add one moreTheMarkster wrote: ↑Sun Aug 19, 2018 11:42 pm Here is a macro to help ease the pain of creating spreadsheet aliases.
Usually when I setup a spreadsheet it looks something like this:
EasyAlias-scr1.png
I'll have my labels in Column A and my values and aliases in Column B. The label in Column A is completely irrelevant to FreeCAD; all it cares about is the alias and content in Column B because I'll set my constraint in a sketch (or some property of an object) to something like Spreadsheet.radius (where radius is one of the Column B aliases). This works fine, but the only issue is it can be somewhat tedious and time-consuming (not to mention cumbersome, awkward, and aggravating) to setup the aliases. It occurred to me the string I use for my Column A label will almost always make a suitable alias for the cell in Column B, so why not automate the process to use that label for the alias? Why not, indeed.
Here is a screencast:
easy-alias.gif
Row to the next row
Because with Row it is possible to comment
Thank you very much
- Attachments
-
- alias.png (99.44 KiB) Viewed 4567 times
- xsuper9988
- Posts: 223
- Joined: Sat Oct 24, 2020 4:20 am
Re: EasyAlias macro
Very sorryTheMarkster wrote: ↑Sun Aug 19, 2018 11:42 pm Here is a macro to help ease the pain of creating spreadsheet aliases.
Usually when I setup a spreadsheet it looks something like this:
EasyAlias-scr1.png
I'll have my labels in Column A and my values and aliases in Column B. The label in Column A is completely irrelevant to FreeCAD; all it cares about is the alias and content in Column B because I'll set my constraint in a sketch (or some property of an object) to something like Spreadsheet.radius (where radius is one of the Column B aliases). This works fine, but the only issue is it can be somewhat tedious and time-consuming (not to mention cumbersome, awkward, and aggravating) to setup the aliases. It occurred to me the string I use for my Column A label will almost always make a suitable alias for the cell in Column B, so why not automate the process to use that label for the alias? Why not, indeed.
Here is a screencast:
easy-alias.gif
because I'm in a hurry to use
I added a new version myself
If there is any inappropriate
telling me to delete
or release a new version
tell me to download
thank you very much
- Attachments
-
- EasyAliasColRow.gif (697.42 KiB) Viewed 4536 times
-
- Easy-alias-Col-icon.png (977 Bytes) Viewed 4536 times
-
- Easy-alias-Row-icon.png (983 Bytes) Viewed 4536 times
-
- Macro_EasyAliasCol.FCMacro
- (5.13 KiB) Downloaded 97 times
-
- Macro_EasyAliasRow.FCMacro
- (5.13 KiB) Downloaded 83 times