Silent operation and ilogic

Silent operation and ilogic

DWhiteley
Advisor Advisor
2,993 Views
7 Replies
Message 1 of 8

Silent operation and ilogic

DWhiteley
Advisor
Advisor
If I start a new document with silentoperation set to true, external ilogic rules still run. How can I stop this?

Thanks in advance
Dave
0 Likes
Accepted solutions (1)
2,994 Views
7 Replies
Replies (7)
Message 2 of 8

ekinsb
Alumni
Alumni
Accepted solution

The SilentOperation property doesn't have any impact on iLogic and is primarily intended as a way to suppress the display of dialogs that would usually pop up during an operation.  I did find an iLogic setting though that I believe should work in your case.

 

iLogicVb.Automation.RulesOnEventsEnabled = False

' Create the new document.

iLogicVb.Automation.RulesOnEventsEnabled = True

Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 3 of 8

DWhiteley
Advisor
Advisor
How do I access iLogicVb in the API?



Dave



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
0 Likes
Message 4 of 8

DWhiteley
Advisor
Advisor
How do I access iLogicVb in the API?



Dave



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
0 Likes
Message 5 of 8

DWhiteley
Advisor
Advisor

Just to explain, I'm using the API & VB.NET.

Sorry, should have mentioned this first.

 

 

Dave

0 Likes
Message 6 of 8

clotto56AVL
Explorer
Explorer

I have the same problem, using API, not directly on iLogic.

Could you solve this problem?

0 Likes
Message 7 of 8

Raider_71
Collaborator
Collaborator

Hi I have created a function you can try. Call it in your app as required.

    Sub iLogicRulesEnabled(oEnabled As Boolean)
        Dim addIn As ApplicationAddIn
        Dim addIns As ApplicationAddIns

        addIns = oApp.ApplicationAddIns

        For Each addIn In addIns
            If InStr(addIn.DisplayName, "iLogic") > 0 Then
                Try
                    addIn.Activate()
                    Dim iLogicAuto As Object
                    iLogicAuto = addIn.Automation

                    iLogicAuto.RulesOnEventsEnabled = oEnabled
                    Exit For
                Catch ex As Exception
                End Try
            End If
        Next
    End Sub

 

Message 8 of 8

WCrihfield
Mentor
Mentor

Good point with accessing that one setting through the ApplicationAddIn object representing the iLogic add-in @Raider_71.

Since 'iLogic' is an add-in within Inventor, we can find the ApplicationAddIn object representing it, then get the value of its ApplicationAddIn.Automation property to a variable, as an Object.  Then that variable can essentially be used the same was as the IiLogicAutomation Interface, which is what we get from the [iLogicVb.Automation'] code phrase within an iLogic rule.

The other two similar properties of that object are:  RulesEnabled & SilentOperation.

 

There are actually at least 3 different places where we have control over a setting named 'SilentOperation'. One is just under the main Inventor.Application object (Application.SilentOperation).  One is under that main iLogic Automation object.  And one is for each individual iLogicRule object (iLogicRule.SilentOperation).

 

Similar for the other settings controlling rules running when events happen.  There are settings for that which can only be set/changed manually, which will override the authority (on the security side) of any settings that we can change by code.  Those settings can be reached by going to the Tools tab, Options panel, clicking on the 'iLogic Configuration' tool to open that dialog.  Then clicking on the [Security Options] button within that dialog, which opens another small pop-up labeled 'iLogic Security'.  The settings you set there will override any similar sounding ones that you can access or change by code, for security reasons.  Then there are the settings mentioned above, just under the main iLogic add-in's Automation object.

WCrihfield_0-1744386412777.png

Then there are similar settings for each individual iLogicRule object.

WCrihfield_1-1744386437365.png

iLogicRule.AutomaticOnParamChange 

iLogicRule.FireDependentImmediately 

iLogicRule.IsActive 

iLogicRule.SilentOperation 

(no code based access to the option named 'Straight VB Code', as far as I can tell)

And besides the strategy of using the ApplicationAddIn.Automation object to get partial access to some of those settings, we can also 'pass' the uniquely iLogic 'RuleObject' named "iLogicVb" (which is the ILowLevelSupport Interface) out to our external resources (such as a Class) for temporary use, if needed, either through an 'input parameter' of a method, or by setting it as the value of a Public property of the external resource.  This can give an otherwise purely Inventor API or vb.net based code resource access to uniquely iLogic resources.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes