iLogic rules pop up an error when problem with relationships

iLogic rules pop up an error when problem with relationships

Anonymous
Not applicable
514 Views
4 Replies
Message 1 of 5

iLogic rules pop up an error when problem with relationships

Anonymous
Not applicable

I'm working with six axis 3D model robot and I'm trying to check range possibility in different situations. To automate the process I've created a rule where I'm applying calculated values (distances) to the relationship between robot TCP and parts in different places. I would like to get an information if there is a problem with current existing relationships (robot cannot reach requested position without braking existing relationships between his joints).

 

For example I force him in the rule to move out of range and update the assembly with command:

Parameter("d1") = 1700
iLogicVb.UpdateWhenDone = True

 If parameter d1 is in the range everything is fine, and drawing update correctly.

When parameter d1 is out of range nothing happens (but I can see in the browser that parameter is updated). I have to "touch" my model to get an update of drawing and get an error:

Capture_inv.PNG

 

How to get this error automatically in iLogic rules? I would like to inform the user that there is a problem (with a pop up) and do something...

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

clutsa
Collaborator
Collaborator

How about something like this...

Parameter("d6") = 90
InventorVb.DocumentUpdate()
For Each oConstraint In ThisApplication.ActiveDocument.ComponentDefinition.Constraints
	If Not oConstraint.HealthStatus = HealthStatusEnum.kUpToDateHealth Then
		MessageBox.Show(oConstraint.Name & " has an error", "Title")
	End If
Next
If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

0 Likes
Message 3 of 5

Jon.Balgley
Alumni
Alumni

note that if one constraint is sick, there are probably several, so this code will show a bunch of message boxes.  best to collect all sick ones  and report once.


Jon Balgley
0 Likes
Message 4 of 5

clutsa
Collaborator
Collaborator
Accepted solution

Good call Jon! in using this myself I like to believe I would have come to that conclusion.

Parameter("d6") = 90
RuleParametersOutput()
InventorVb.DocumentUpdate()
Dim MyErrorList As New ArrayList

For Each oConstraint In ThisApplication.ActiveDocument.ComponentDefinition.Constraints
	If Not oConstraint.HealthStatus = HealthStatusEnum.kUpToDateHealth Then MyErrorList.Add(oConstraint.Name)
Next
If MyErrorList.Count > 0 Then
	Dim ErrorMsg As String = "These mates have errors: " & vbCr
	For Each oErr In MyErrorList
		ErrorMsg = ErrorMsg & oErr & vbCr
	Next
	MessageBox.Show(ErrorMsg, "Title")
End If
If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

0 Likes
Message 5 of 5

Anonymous
Not applicable

It works perfectly! Thanks a lot your help clutsa and Jon

 

Best regards,

Paweł

0 Likes