ILOGIC SNIPPET ERROR

ILOGIC SNIPPET ERROR

Anonymous
Not applicable
865 Views
4 Replies
Message 1 of 5

ILOGIC SNIPPET ERROR

Anonymous
Not applicable

Hi Everyone,

 

I have a run into an error. I know what the cause is but am having some difficulty figuring out a solution.

 

I have a wall that can be either be a wall or a cargo door.

The wall has several features that can be controlled. Cutouts etc..

 

The problem is when I select cargo door all the wall parts are suppressed but the code runs regardless for the wall features and gives me the following(see attached).

The problem goes away when I remove all the code related to wall features.

 

I hope this makes sense. Is there a way I can solve this??

 

Michael

0 Likes
Accepted solutions (1)
866 Views
4 Replies
Replies (4)
Message 2 of 5

FINET_Laurent
Advisor
Advisor

You should use the try/catch function.

 

Try 
	'try the command that gives error 
Catch 
	'do nothing
End Try

Here is a bit of documentation. 

https://knowledge.autodesk.com/support/inventor-engineer-to-order/learn-explore/caas/CloudHelp/cloud...

 

Regards,

 

FINET L.

If this post solved your question, please kindly mark it as "Solution"

If this post helped out in any way to solve your question, please drop a "Like"

@LinkedIn     @JohnCockerill

0 Likes
Message 3 of 5

Anonymous
Not applicable

Cheers for the reply

 

so the same code? now I have 

 

If

else if

end if

 

Do I just replace with your solution?

0 Likes
Message 4 of 5

FINET_Laurent
Advisor
Advisor
Accepted solution

You can keep the same code and add the try/Catch.

 

If "what ever it is" Then 

	Try
	
		'Try the block of commands that is giving error on certain circumstances (if it can then it does,if not it skips the line so you don't get the error message and the rule doesn't stop
		
		
	Catch 
		
		'what you want to happen if it gives an error (Nothing in this case from what i understand
	
	End Try 
	
Else If 
	
End If    

 Hope this is clear. If not can you share the code ?

 

Regards,

 

FINET L.

If this post solved your question, please kindly mark it as "Solution"

If this post helped out in any way to solve your question, please drop a "Like"

@LinkedIn     @JohnCockerill

0 Likes
Message 5 of 5

Anonymous
Not applicable

I tried it and it seems to have worked.