need help with iLogic rules for getting value

need help with iLogic rules for getting value

bhavik.sutharWZ5M5
Explorer Explorer
280 Views
2 Replies
Message 1 of 3

need help with iLogic rules for getting value

bhavik.sutharWZ5M5
Explorer
Explorer

Hello,

 

I need help with regards to getting values for variables.

 

Here in the rule, "x2" value is being used for a further round of and addition, To do so, "x2" value comes from measuring the minimum distance between two entity, now I placed to x2 variable in which the only one will suppose to give integer value and other won't because it will be suppressed in an assembly so it pops out the message that so and so component not found.

 

Is it possible to put any loop or other function which will return me the integer value whether it's in line 1 or line 2 and accordingly use in the subsequent rule?

 

Line 1:  x2 = Measure.MinimumDistance("M7048-0137, LX0260 50-60Hz:1", "Work Axis1", "G0011-0229:1", "Face0")
Line 2:  x2 = Measure.MinimumDistance("M7048-0137, LX0260 50-60Hz:1", "Work Axis1", "G0011-0416:1", "Face0")

x3 = x2 + 50

x1 = Floor(x3)

MessageBox.Show(x1, "X1")

 

0 Likes
281 Views
2 Replies
Replies (2)
Message 2 of 3

ianteneth
Advocate
Advocate

Hi @bhavik.sutharWZ5M5,

 

I think you need an IF statement. Here is some pseudo code to achieve this. Let us know if you need help implementing this.

 

' If G0011-0229:1 is not suppressed Then
    x2 = Measure.MinimumDistance("M7048-0137, LX0260 50-60Hz:1", "Work Axis1", "G0011-0229:1", "Face0")
' Else If G0011-0416:1 is not suppressed Then
    x2 = Measure.MinimumDistance("M7048-0137, LX0260 50-60Hz:1", "Work Axis1", "G0011-0416:1", "Face0")
' End If

x3 = x2 + 50
x1 = Floor(x3)
MessageBox.Show(x1, "X1")

 

0 Likes
Message 3 of 3

WCrihfield
Mentor
Mentor

You could also use the Try...Catch...End Try technique.

Try
	'tries to do this
	x2 = Measure.MinimumDistance("M7048-0137, LX0260 50-60Hz:1", "Work Axis1", "G0011-0229:1", "Face0")
Catch
	'first option didn't work, so do this instead
	x2 = Measure.MinimumDistance("M7048-0137, LX0260 50-60Hz:1", "Work Axis1", "G0011-0416:1", "Face0")
End Try

x3 = x2 + 50
x1 = Floor(x3)
MessageBox.Show(x1, "X1")

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes