iLogic code for "done" in form

iLogic code for "done" in form

berry.lejeune
Advocate Advocate
835 Views
3 Replies
Message 1 of 4

iLogic code for "done" in form

berry.lejeune
Advocate
Advocate

Hello everyone,

 

I'm running some codes and a form in a template IPT to create my parts.

In a form (picure 3) I fill out my dimensions and some parameters and hit the "done" button and then run the rule (picture 2) the part gets saved in a format of "project" "partnumber" in a defined  folder. 

Now I added extra buttons in the form (picure 1) so I can immediatley run the rules from the form. But when I run one of these 2 rules, the form stays always open.

Is there a specific line of code that I can add to the iLogic what will also close the form?

 

Thanks

 

0 Likes
836 Views
3 Replies
Replies (3)
Message 2 of 4

bradeneuropeArthur
Mentor
Mentor
You will need to create a new form object, with a label. Than you need to change the label text to done.
Best way to go is building it with vb.net and run that with ilogic or via an addin.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 4

WCrihfield
Mentor
Mentor

Hi @berry.lejeune.  Is this iLogic Form an 'internal' one (saved within the Inventor document), or a 'Global' one?  If it is an internal one, then when you have one of those 'run a rule' type buttons selected in your Form Editor dialog, you should see an option down below labeled 'On Click Action', where you can specify what all should happen when you click that button.  Two of those options will include closing the Form.  If it is a Global form, then you may not have that option available.  But in Inventor 2024, we now have the ability to close an iLogic Form from an iLogic rule, using new System (built-in) iLogic snippets.

WCrihfield_0-1685107670797.png

Edit:  The 'On Click Action' option is only available if the iLogic Rule is an 'internal' one.  Whether the iLogic Form itself is an 'internal' or 'Global' one makes no difference.  If the rule is an 'external' one, you will also not have that 'On Click Action' Option available.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 4

WCrihfield
Mentor
Mentor

Also, just in case you were not aware of this...if you launch the iLogic Form with an iLogic rule, as 'Modal' (pauses other code while it is open), you can actually get very basic feedback from that form that will let you know when and why the Form closed.  Below is a very basic example of an iLogic rule code utilizing this feature.

Dim oFRValue As FormReturnValue = iLogicForm.Show("FormName", FormMode.Modal)
If oFRValue.Result = FormResult.Done Then
	MsgBox("The iLogic Form Was Closed With 'Done' Button.", vbInformation, "Form Closed")
ElseIf oFRValue.Result = FormResult.RuleButtonApplyAndClose Or _
	oFRValue.Result = FormResult.RuleButtonClose Then
	Dim sRuleName As String = oFRValue.RuleName
	MsgBox("The iLogic Form Was Closed By A Rule Button.  The Rule's Name = " & sRuleName, vbInformation, "Form Closed")
End If

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)