Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"IF" fonction in solidedge 3

Status
Not open for further replies.

libanais

Mechanical
Jul 15, 2004
10
0
0
CA
Hello

Im having trouble with IF fonctions in solidedge,i can compare 2 variables but its with 3 variables that thing get complicated..
The exercice is a simple cube with three cylinder protruding out the goal is to make the width of the cube equal the biggest of the three cylinders(A,B,C)

Thanks:)
 
Replies continue below

Recommended for you

I am not sure if this is what you are after.

I am assuming that you are using notepad as a .bas file and then linking this in the variables.

Sub cylinderTest(ByVal InX, ByVal InY, ByVal InZ, ByRef OutX)

If InX > InY And InX > InY then
OutX = InX
ElseIf InY > InZ then
OutX = InY
Else OutX = InZ
End If
End Sub

Where InX = cylinder 1
InY = cylinder 2
InZ = cylinder 3
OutX = the width of the block


Craig Brunton
 
Thanks for the help guys:)

Just one last question, i know that i can link a formula from excell to SE, but can i do the opposite i.e when i change a value in SE it changes it in Excell?
 
As far as I am aware you cannot do this. If you link a variable then you are unable to change this outside of excel unless you delete the link.

Craig
 
You may want to try this;

In the SE Variable Table, select the row you want link.
Click 'Copy Link' in the shortcut menu.
Then in Excel, use 'Paste Link' from 'Paste Special' function to paste the link to a cell.

Now when you change the value in that row in SE, you’ll see the changes in Excel.
I hope this is what you are looking for.

Regards
 
Thanks fwc!
That really worked:)
You seem to be an excel expert,if you dont mind i have one more question for you.

I want to use the IF function in excel but with a twist..here an example of what im aiming for

IF A1=(5,10,15,20)

THEN 0 IF FALSE
THEN 1 IF TRUE

My problem is making excel pick between only 5 OR 10 OR 15 or 20,(depending on what value is in cell A1)

In short IF A1 EQUAL 5 OR 10 OR 15 OR 20 THEN THE ANWSER IS 1 anything else is 0

I hope i was clear:)
thanks
 
FWC

I managed to link SE variables to Excel but because SE adds the " or Inch after a value therefore when excel tries to read for my "IF" function i think it sees it as a text and not a number, is there a way to tell excel to ignore what comes before and after the value?

i.e this is what appears in excel linked via SE 5.000 in

but

I want excel to just read the "5" and drop the rest!

thanks again:)
 
Hi

This should work,

=Left(A1)
The above will return as 5


=Left(A1,4)
The above will return as 5.00


Replace 'A1' with the formula.

HTH.

Regards


 
Hi

The 5 is still a text and not a number.

Try multiplying the formula to 1 as below;

=Left(A1,4)*1

Maybe you can try with the formula below;

=IF(A1="5.000 in",1,IF(A1="10.000 in",1, IF(A1="15.000 in",1,IF(A1="20.000 in",1,0))))

HTH

Regards


 
Hello,

The function wizard in Solid Edge is great but it lacks the IF logical statement. This can be done however as a formula.

Here is an example of the syntax: -7*(A=32)+(-12*(A<>32))

Here is how this works: In this example, you've got two variables, "A" and "B". This formula will exist in the B formula field. In this case, You want the value of B to be 7 if A is equal to 32. If A is not 32 then you want 12 returned to the B value.

You can put any logical statement in parenthesis and it returns -1 if true and 0 if false. Knowing this, the above formula says "If A is equal to 32, then multiply -1 times -7 and 0 times 12, but if A doesn't equal 32 then multiply -7 times 0 and -12 times -1". Try it.

Fred

 
Status
Not open for further replies.
Back
Top