Conditional Deletion of a Function in Equations - SW

Hello

I'm doing the SolidWorks tutorial on equations and I'm stuck on function removal with the If condition.

In theory, according to the tutorial, we should put:

Conditionally deleting a feature

Chamfer1=if("Diamètre d'arbre de broche" <1mm, "supprimé","suppression annulée")

And it doesn't work. I tried Delete/Undelete and then Suppressed/Unsuppressed, 1/0, with "," as the separator, with "; " as a separator.

For the moment it's a blank slate.

Does anyone know how to do it?

Thank you

 

At home on SW2016 this works:

= IIF ( 1 = 1 , "suppressed" , "unsuppressed")

 

Edit: Maybe it's because you put capital letters. At home, if I go to "Global variables" in the IF, it offers me "Deleted" and "Undo deletion", and then it replaces that with the English terms.

Edit2: You don't normally need (or you shouldn't, I don't know if we can) put the "mm" after the 1.

Your function should rather give something like: = IIF("Spindle shaft diameter" < 1, "suppressed", "unsuppressed")

2 Likes

I just typed:

And it's always a mistake

SW version? (I ask, even if I suspect it's not the case, but you don't have the Bug with the Windows update?)

Is "Chamfer1" the correct job name?

A file for us to test?

 

Edit: Did you close the paranthesis at the end?

1 Like

Yes, "Chamfer1" is the correct function, I selected in the FeatureManager.

There is a parenthesis at the end:


my_ejector_pin.sldprt

The number of p's in ?

suppressed", "unsuppressed

1 Like

In time for me, this blow if I didn't put 2"p" to unpressed.

1 Like

But when I put it correctly, my line becomes:

it is practically empty; only IIF(

On the other hand, the "Equivalent to" column is "Suppressed"

And when I close and reopen the equation manager, I'm in error:

Ok I found it. It comes from the name of your variable, avoid apostrophes. If you put a simpler name to try like "T1", it should work.

1 Like

Thanks @ KVuilleumier !! That's right.

You should not put an apostrophe in the name of the global variable.

And it's in the SolidWorks tutorial which must be a word-for-word translation

1 Like

Subsidiary question:

When you start typing =, you have a small drop-down menu that appears allowing you to select the global variables (including delete them / Undelete them), functions, ...

Is there a trick to make it reappear when you type your line, it would be much more practical than writing all the text by hand (and safer!)