Break expression links
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: 384
- Joined: Sat Sep 24, 2016 6:51 am
Break expression links
Is there any way to break all expression links & hold corresponding values only ?
Re: Break expression links
There was a plan to have global overlay of all expressions. But the plan didn't materialize yet.
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Break expression links
If just in spreadsheet, try this:
Code: Select all
obj = Gui.Selection.getSelection()[0]
for prop in obj.PropertiesList:
try:
expr = obj.getContents(prop) #raises ValueError if not a cell
except ValueError:
continue
if expr.startswith('='):
obj.set(prop, str(getattr(obj, prop)))
-
- Posts: 384
- Joined: Sat Sep 24, 2016 6:51 am
Re: Break expression links
Thanks for support. I will try.