Maximum and minimum functions are present in ms excel. In solid edge I want to use same functions into variables. Actually I have an assembly where one of the dimension should be minimum of other two dimensions.
Say V101=minimum (V102 , V103)
how to do this in solid edge. What is the syntax to write this type of equations. Do solid edge supports logical operators in variable tables?
Variable table in the current version does not support the minimum function.
But there are several possibilites assuming you want to compare just two values:
1. From the variable table right-click the row for V102 and select Copy Link from the context menu. Go to Excel and Paste Special, select the Paste Link radio button in the dialog that appears.
Ditto for V103. This will setup a SE-Excel link for the variables to compare. Use the cells in Excel in the =MIN() function there.
Next Copy the result of the MIN() function from Excel and back in the variable table, Paste Link (not Paste) the result into V101. This wil setup a Excel-SE link and everytime the values of V101 or V102 chage in Solid Edge they will be updated in Excel and the result of MIN() from Excel will be updated in Solid Edge.
2. Another method would be to write a little logic for calculating the minimum (actually smaller) of the two values. Use notepad and paste the following code:
Function minimum(ByVal V102 As Double, ByVal V103 As Double) As Double
If V102 < V103 Then
minimum = V102
ElseIf V103 < V102 Then
minimum = V103
Save the file as minimum.bas (avoid saving as minimum.txt).
In the variable table click in the cell for V101 and click the Function (fx) button.
Select Visual Basic from the list and pick the minimum.bas file.
Select the function that reads minimum.minimum and click Next.
Specify V102 and V103 and click Finish
Note however that both methods are an overkill to just find the smaller of two given numbers.
Hope this helps.
Tried it out, works like a charm.
Scanned the SE ST 6 online help on variable table thoroughly but could not locate where it says logical operators could be used.
Further I tried this out in Excel but it always gives me a negative value: