Design Checker custom Check with iLogic --> Needs to be in "failed" folder

Design Checker custom Check with iLogic --> Needs to be in "failed" folder

Anonymous
Not applicable
422 Views
2 Replies
Message 1 of 3

Design Checker custom Check with iLogic --> Needs to be in "failed" folder

Anonymous
Not applicable

Hi, 

 

I'm trying to check, if the Design Checker App from Autodesk is fitting our needs.

 

What I'm now trying to do is:

 

Creating rules acc. to our Design Guideline. 

(Except that the number of event triggers is a little bit low, the iLogic rules are running as they should.)

 

The problem I'm now facing is, how do I get a result of the rule into the "failed" structure of the tree. The rule is running and it will be placed into the "passed" structure. Do I need to create some sort of exception?

 

Greetings

 

Passi

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

YuhanZhang
Autodesk
Autodesk

There is a sample in the Design Checker help to find how to configure the iLogic rule for a custom checker, like below picture shows, you can search iLogic in the help:

 

DesignChecker.png

 

 

and then follow the instruction to configure your custom checker with the iLogic rule, you should be able to find the sample iLogic rule from below folder:

 

C:\ProgramData\Autodesk\ApplicationPlugins\Autodesk Design Checker.bundle\Contents\Windows\iLogic\

 

And the "Writing custom rule" demonstrates when the checker should return failure(0), hope this helps:

DesignChecker1.png

 

 



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 3

Passi10
Enthusiast
Enthusiast

I've tried all the examples. And now I found my mistake:

 

I've created a new rule ac. to the guidelines. Then I hit "Save and Run" in the iLogic rule, and that was my mistake...

There appears an error message I cannot deal with. The only thing I needed to change was: To add a try catch around the last lines with the arguments… and hit the "re-run all checks" button.

 

This is the code: (It actually does nothing special, only checking, if more than one component in an assembly is grounded. If yes, return = 0 if no, return = 1)

 

thanks for your support.

 

retval = -1
msg = ""

Dim Checker As Boolean = True
Dim i As Integer = 0 

    If ThisApplication.ActiveDocument.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
        Dim Baugruppe As AssemblyDocument = ThisApplication.ActiveDocument
        For Each Element As ComponentDefinition In Baugruppe.ComponentDefinitions
            For Each oOccurrence As ComponentOccurrence In Element.Occurrences
                If oOccurrence.Grounded = True Then
                    Checker = False
		i = i +1
                End If
            Next
        Next
		If i > 1 And Checker = False Then
			retval = 0
			msg = "More than one component is grounded."
		Else
			retval = 1
			msg = "Everything ok."
		End If
End If
    
Try
	RuleArguments.Arguments.Value("ReturnValue") = retval
	RuleArguments.Arguments.Value("Description") = msg
Catch
End Try