SetFormulaByName fails

orchid

#1

Hi @erfajo, others,

Since I had some families in need of some SP, I’m running a script with your nodes. Had to update them and read it’s now Orchid. Fine. Installed Orchid,

I noticed an error:
FamilyDocument.SetFormulaByName
Error: Naamloos

Did something change (is it indeed a ‘bug’) or do I have to alter my nodesinput with this new version?

Oh btw:
SP are made (the 3 in the codeblock)
Setformula isn’t.


#3

all values send to formulas need to be set with quotation mark, you need to replicate the exact behavior as inside Revit… strings would be set as “string” in a formula.


#4

Ah I see. Thanks for clearing that @erfajo! Out of curiosity: why did you change that? It used to be a string instead of “string”?


#5

I have not changed that… this is how it has been all the time.

do you think you can confuse this with how to feed it from a codeblock?

"\"string\""

or did you previously send parameters to the formula? in that case if a parameter named string exist, then feed it with string without quotation marks.


#6

Hmm no I mean I used to input the values for the Formulanode as actual string blocks (not a code block). And those values were accepted. So ended up with parameter fields populated with “value” at the formula fields, as it should.

Now I added the “” in the string blocks, problem solved.


#7

But that part was not changed, it has always been like this.

Maybe in the very first version I did accept input without quotation marks (and set them in the code), but I figured quite fast that this would be an error, since you wouldnt be able to send formulas depending on other parameters this way.


#8

Yeah, good call to do so. Totally makes sense (now) :+1::+1: