i-Logic , stop updating model if DIMS are wrong or not allowed.

i-Logic , stop updating model if DIMS are wrong or not allowed.

Anonymous
Not applicable
505 Views
3 Replies
Message 1 of 4

i-Logic , stop updating model if DIMS are wrong or not allowed.

Anonymous
Not applicable

Hello,

 

I am designing a ladder and I want the maximum number of steps to be 16.

User only provides the height, and the parameters create the number of steps.

So if the user provides a height that needs more than 16 steps there is a pop up message that informs the user that needs to give sorter height and at that point I want my model not to update and have the last working dimensions.

I was thinking maybe something like the break command (C++)?

I have also tried to loop the height so I can provide the closest dim to 16 steps but software seems to stop working.

Any thoughts?

 

 

If step_final > 17 Then
	MessageBox.Show("Steps must be less than 16, Please place a landing", "TECHNICAL SPECIFICATIONS")
	Do 
		Heigth  = Heigth - 100
	Loop Until n_final < 17

End If	

 

0 Likes
Accepted solutions (1)
506 Views
3 Replies
Replies (3)
Message 2 of 4

Curtis_Waguespack
Consultant
Consultant

Hi @Anonymous 

 

Programming questions of this type are better asked on the Inventor Customization forum :
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

With that in mind for the future, I don't think the program stops working, but you are sending it into an endless loop. Without seeing your complete code , I think maybe something like the example below would work.

 

reference link

https://www.dotnetperls.com/for-vbnet

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

oHeight = InputBox("Enter Ladder Height", "iLogic", 1500)
oLadderStep = InputBox("Enter Height of each step in the ladder", "iLogic", 100)

' This loop uses -Step to go down oLadderStep each iteration.
i = 0
For Actual_Height As Integer = oHeight To 0 Step - oLadderStep		
	
	If i = 16 Then
		MessageBox.Show("Max number of steps is 16, Please place a landing", "TECHNICAL SPECIFICATIONS")
		Exit For 'exit loop
	Else 
		i = i + 1
		'code to add step to model goes here

	End if    
Next

MessageBox.Show("Number of Steps = " & i & vbLf & _
	"Actual total height is " & i * oLadderStep, "ilogic")

EESignature

Message 3 of 4

Anonymous
Not applicable

Hi, thank you for the reply and next time i will post these kind of questions at the correct forum.

This solution is not what I am actually after. I have my model designed in a way that steps are generated  by a pattern- i don't use i-logic for that-  and steps have only a minimum height that changes accordingly with the ladder's height. There is no other code everything else is at the parameters table. I was after a "stop" command like the exit loop that you wrote, but to prevent model to update when the user enters a "wrong" or too "big" dimension.

I will try definitely use the loop command in the future.

 

Thank you

 

0 Likes
Message 4 of 4

Anonymous
Not applicable
Accepted solution

After some time I manage to find a solution.

for future reference if anyone has a similar problem with me

 

'maximum number of steps is 16

If
n_final > 16 Then Heigth = 3000 mm MessageBox.Show("The maximum noumber of steps is: " & "16" & vbCr & "Ladder will automatically use the maximum height.", "Maximum Value Rule", MessageBoxButtons.OK, MessageBoxIcon.Error) End If

 

Thank you