×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

"IF" fonction in solidedge
3

"IF" fonction in solidedge

"IF" fonction in solidedge

(OP)
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:)

RE: "IF" fonction in solidedge

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

RE: "IF" fonction in solidedge

2
Hi

I would use the 'Max' function in Excel and link it to SE.

HTH.

Regards

RE: "IF" fonction in solidedge

(OP)
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?

RE: "IF" fonction in solidedge

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

RE: "IF" fonction in solidedge

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

RE: "IF" fonction in solidedge

(OP)
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

RE: "IF" fonction in solidedge

Hi

I hope this is what you are looking for;

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


Regards


RE: "IF" fonction in solidedge

(OP)
Thanks fwc thats exactly what i was looking for!

RE: "IF" fonction in solidedge

(OP)
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:)

RE: "IF" fonction in solidedge

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


RE: "IF" fonction in solidedge

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


RE: "IF" fonction in solidedge

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources