Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to stop the code in middle of the process

2 REPLIES 2
Reply
Message 1 of 3
linuskotte
400 Views, 2 Replies

How to stop the code in middle of the process

Hi ,

 

Here i have one problem in coding.

 

Iam using ilogic to modify the boxes:

 

I have a one rectangular box in that box again small rectangular boxes in this my problem is when iam giving value for smaller boxes(all boxes height) more than outer box how it will show the message box and how to stop the code.

 

Capture.PNG

 

 

d1=big box height

d2,d3,d4---small boxes height

I am writing code like this:

 

IF((d2+d3+d4)=<d1) then

Msg.box(give correct value)

end if

 

here it's showing the message and it,s not stoping the program.

 

 

Thanks & Regards,

LINUS KOTTE

2 REPLIES 2
Message 2 of 3
rjay75
in reply to: linuskotte

Do you have any more code after the you do the check and display a message? If so change your code to only do the rest if the check is valid.

 

If (( d2 + d3 + d4 ) =< d1 ) Then

  MsgBox("give correct value")

Else

  <<< Put the rest of your code here >>>

End If  <<< Don't put anymore code after this

Message 3 of 3
eljoseppo
in reply to: rjay75

 or this code:

If (( d2 + d3 + d4 ) =< d1 ) Then
  MsgBox("give correct value")
  Exit Sub
End if
'rest of your code

the difference is very small but you don't have to remember about "End if" at the end of the rule.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report