Break expression links

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
Post Reply
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Break expression links

Post by jaisejames »

Is there any way to break all expression links & hold corresponding values only ?
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Break expression links

Post by triplus »

There was a plan to have global overlay of all expressions. But the plan didn't materialize yet.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Break expression links

Post by DeepSOIC »

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)))
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: Break expression links

Post by jaisejames »

Thanks for support. I will try.
Post Reply