Hi,
My part is mostly completed, and I want to do some cleanup.
I want to delete all the useless aliases that I created in the spreadsheet. I want to find out where a particular alias is being used.
Is it possible to search for aliases in Freecad?
Thanks!
Is it possible to find out where my spreadsheet aliases are being used via a search?
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 29
- Joined: Wed May 05, 2021 1:35 am
Re: Is it possible to find out where my spreadsheet aliases are being used via a search?
You can unpack the FreeCAD file and search through the File Document.xml. Unpacking can be done with a common unzip or with the tool available via menu->Tools->Project utility.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Is it possible to find out where my spreadsheet aliases are being used via a search?
Perhaps you could modify Macro TreeToAscii to show this information?
(or petition the macro author to add it)
Re: Is it possible to find out where my spreadsheet aliases are being used via a search?
Hi,
You can run this little function to list all the objects of the active document that use the given string in expressions :
you can then perform new searches by simply repeating the last command with other string :
You can run this little function to list all the objects of the active document that use the given string in expressions :
Code: Select all
def search_alias_connection(name=""):
"""Search all the objects of current document that contain
the given string in an expression"""
doc = App.ActiveDocument
for o in doc.Objects:
if hasattr(o, "ExpressionEngine"):
for exp in o.ExpressionEngine:
if name in exp[1] or name is None:
print("{} used in property {} of object {}".format(exp[1], exp[0], o.Label))
search_alias_connection("Alias_1")
Code: Select all
search_alias_connection("Alias_2")
Re: Is it possible to find out where my spreadsheet aliases are being used via a search?
Really useful, thank you. Generating a macro for thissearch_alias_connection("Alias_2")
[Should this be part of FC - Spreadsheet -> Select cell -> Alias .. Where used ...?
-
- Posts: 29
- Joined: Wed May 05, 2021 1:35 am
Re: Is it possible to find out where my spreadsheet aliases are being used via a search?
+1
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.