Ilogic code correction

Ilogic code correction

Anonymous
Not applicable
324 Views
2 Replies
Message 1 of 3

Ilogic code correction

Anonymous
Not applicable

Can someone help me solve this problem?

In the following ilogic code, I want to run the first part of the rule when I type Rec when the part is rectangular and when I type Cir, it runs the second part only. But it is not the case. It is only executing the else part of the ilogic. 

 

If myparam = InputBox("Type 'Rec' if the part is rectangular or square or Type 'Cir' if the part is circular", "Shape Specification", "Type",Rec) Then
	
	extents_length = Measure.ExtentsLength
		extents_length = Round(extents_length)
	extents_width = Measure.ExtentsWidth
		extents_width=Round(extents_width) 
	extents_thickness= Measure.ExtentsHeight
	iProperties.Value("Custom", "SPECIFICATIONS") = "PLATE " & extents_thickness & " THK " & extents_length & " x " & extents_width
		
Else

	extents_length = Measure.ExtentsLength
		extents_length = Round(extents_length)
	extents_thickness = Measure.ExtentsWidth
	iProperties.Value("Custom", "SPECIFICATIONS") = "PLATE " & extents_thickness & " THK Ø " & extents_length
	
End If

 

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

R.Mabery
Advocate
Advocate

It looks like your conditional statement is in the wrong place (at least it's one way of changing this).

 

myparam = InputBox("Type 'Rec' if the part is rectangular or square or Type 'Cir' if the part is circular", "Shape Specification", "Type",Rec)
	
If myparam = "Rec"
	extents_length = Measure.ExtentsLength
		extents_length = Round(extents_length)
	extents_width = Measure.ExtentsWidth
		extents_width=Round(extents_width) 
	extents_thickness= Measure.ExtentsHeight
	iProperties.Value("Custom", "SPECIFICATIONS") = "PLATE " & extents_thickness & " THK " & extents_length & " x " & extents_width
		
Else

	extents_length = Measure.ExtentsLength
		extents_length = Round(extents_length)
	extents_thickness = Measure.ExtentsWidth
	iProperties.Value("Custom", "SPECIFICATIONS") = "PLATE " & extents_thickness & " THK Ø " & extents_length
	
End If

 

Get the myParam and then evaluate it.

 


Thanks,
Randy Mabery
Applications Expert
IMAGINiT Technologies
0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks. I will try and let you know if it worked.

0 Likes