Trigger rule after check box in form is checked/un checked

Trigger rule after check box in form is checked/un checked

t_fransman
Advocate Advocate
1,082 Views
5 Replies
Message 1 of 6

Trigger rule after check box in form is checked/un checked

t_fransman
Advocate
Advocate

I have a rule that works, I am trying to control it with a check box in the form. For some reason I have to re run the rule after I check the box in the form. Is there a way to get the rule to run after the form is checked Done or the box has been checked in the form?

0 Likes
Accepted solutions (1)
1,083 Views
5 Replies
Replies (5)
Message 2 of 6

DRoam
Mentor
Mentor
Accepted solution

@t_fransman wrote:

Is there a way to get the rule to run after the form is checked Done or the box has been checked in the form?


Both of these are possible.

 

To run the rule when you click "Done", follow these steps. This will create your own custom "Done" button tied to your rule:

  1. In the form editor, select the very top node for the form itself. In the properties area, change "Predefined Buttons" to "None".
  2. In the browser on the left, click the "Rules" tab.
  3. Find your rule, and drag it into the bottom of the form tree on the right. A button for your rule will be added to your form.
  4. In the Properties area, under "Behavior", change "On Click Action" to the appropriate action as desired. Now this button will both close your form and run your rule.
  5. If desired, you can change the label for your button to "Done".

 

As for the checkbox -- when you say your form has a checkbox, I assume you mean it's connected to a True/False parameter. To have the rule run immediately when you change the checkbox, simply add the name of your true/false parameter to the beginning of your iLogic rule somewhere. For example, if your true/false parameter's name is "MyParam", add this code to your iLogic rule:

 

Dim triggers As String = MyParam

"MyParam" should appear in blue. This means it will trigger you rule when changed.

Message 3 of 6

t_fransman
Advocate
Advocate

awesome thanks I can see both of these options as a good way to control this in dif. situations. 

0 Likes
Message 4 of 6

t_fransman
Advocate
Advocate

By the way

 

Do you know a way to turn a pattern visibility off and make it ref 

 

like this but because it's pattern the instance complain when they do not exist or they come in with a new name. 

 

This is an example of how I've done it when not in a pattern .

 

oComp10 = Component.InventorComponent("CABLE_HOLDER1")
oComp11 = Component.InventorComponent("CABLE_HOLDER2")
oComp12 = Component.InventorComponent("GROMMET1")
oComp13 = Component.InventorComponent("GROMMET2")
oComp14 = Component.InventorComponent("GROMMET3")
oComp15 = Component.InventorComponent("GROMMET4")

If PullCordWeldOnTab = False

oComp10.Visible = False
oComp10.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
oComp11.Visible = False
oComp11.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
oComp12.Visible = False
oComp12.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
oComp13.Visible = False
oComp13.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
oComp14.Visible = True
oComp14.BOMStructure = BOMStructureEnum.kDefaultBOMStructure
oComp15.Visible = True
oComp15.BOMStructure = BOMStructureEnum.kDefaultBOMStructure

0 Likes
Message 5 of 6

t_fransman
Advocate
Advocate

Never mind on the pattern to Reference thing I found a new plan. And thanks again for the great ideas here.

0 Likes
Message 6 of 6

Anonymous
Not applicable

Hello,

 

Please help me for the simple radio box and check box configuration.

I have a rule which rewrite some information from drawing to first view part.

I would like to control this with tue/false value. When I pick the check box, and then activated the drop-down menu and I change this, the value is changed immediately.

I would like to wait, when I pick to rule button.

 

Predefined Buttons = None

On Click Action = Close and then Run Rule

 

The Boolen variables are in the FX - user parameters

 

The rule:

'Alkatrészek, összeállítások típusának és a Pót/kopó besorolásoknak a megváltoztatása
'A program egy adott rajzlapon az először lehelyezett modell paramétereit kiolvassa, majd változtatja

'Változók megadása
Dim oView As DrawingView
Dim DWGViewName As String
Dim oActPart As Document

Dim oDrawing As DrawingDocument
oDrawing = ThisApplication.ActiveDocument

Dim DWGType As String
Dim SparePart As String

Dim oSheet As Sheet
oSheet = oDrawing.ActiveSheet

If oSheet.TitleBlock Is Nothing Or oSheet.DrawingViews.Count = 0 Then
	MessageBox.Show("Üres rajzfájl, vagy nincs nézet!", "Általános üzenet", MessageBoxButtons.OK, MessageBoxIcon.Information)

Else

If Rajz_A_H_Ö_K = "A - alkatrész" Then
	DWGType = "a"
ElseIf Rajz_A_H_Ö_K = "H - hegesztett alkatrész" Then
	DWGType = "h"
ElseIf Rajz_A_H_Ö_K = "Ö - összeállítás" Then
	DWGType = "ö"
ElseIf Rajz_A_H_Ö_K = "K - kerelem" Then
	DWGType = "k"
End If

If Pót_Kopó_alkatrész_P_K = "P - pót alkatrész" Then
	SparePart = "p"
ElseIf Pót_Kopó_alkatrész_P_K = "K - kopó alkatrész" Then
	SparePart = "k"
End If

oView = oDrawing.ActiveSheet.DrawingViews.Item(1)
'DWGViewName = oView.Name
'MessageBox.Show(DWGViewName, "Első nézet neve")

oActPart = oView.ReferencedDocumentDescriptor.ReferencedDocument
'MessageBox.Show(oActPart.DisplayName, "Fájlnév")

Dim invUserDefProp As PropertySet
Dim invProperty As Inventor.Property

'Változó elérése és ha nincs beírása
invUserDefProp = oActPart.PropertySets.Item("User Defined Properties")

Try
	invProperty = invUserDefProp.Item("06. Pót alkatrész / Kopó alkatrész (P/K)")
	invProperty.Value = SparePart
Catch
	invProperty =invUserDefProp.Add(SparePart,"06. Pót alkatrész / Kopó alkatrész (P/K)")	  
End Try

Try
	invProperty = invUserDefProp.Item("09. Rajz A/H/Ö/K")
	invProperty.Value = DWGType
Catch
	invProperty =invUserDefProp.Add(DWGType,"09. Rajz A/H/Ö/K")	  
End Try

oActPart.Save
oActPart.Close

End If

InventorVb.DocumentUpdate()
ThisDoc.Save

 

0 Likes