Copying it into console shows its correct string.
How to execute the string after formatting?
Code: Select all
name = "Untitled"
offset = '3.427079'
obj = 'Extrude'
def changeY():
return(f"App.getDocument('{name}').getObject('{obj}').setExpression('.Placement.Base.y', u'50 - {offset}')")
changeY()
App.activeDocument().recompute(None,True,True)