Button on Toolbar to Start a form

Button on Toolbar to Start a form

steveh5
Advisor Advisor
1,301 Views
10 Replies
Message 1 of 11

Button on Toolbar to Start a form

steveh5
Advisor
Advisor

Gang...

I want to keep our users out of the iLogic panel.

 

So....is there a way to create a button to initiate the forms button?

 

button.jpg

 

Thanks in advance,

 

Steve H.

Steve Hilvers
Inventor Certified User / Vault Professional Influencer
1,302 Views
10 Replies
Replies (10)
Message 2 of 11

bradeneuropeArthur
Mentor
Mentor

With ilogic you need to run everytime a ilogic code to add that button, think that this is not what you need.

With an add-in this is possible to do it on loading and no additional code required.

 

Regards,

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 11

w.pepping
Advocate
Advocate

Hello Steve,

I have a solution that does exactly what you need.

It is a tool that creates buttons to start ilogic rules, forms, .NET files, vba macro’s and even exe files.

The tool is in test phase at the moment.

If you want to try, send me a pm. (the tool is free to use)

 

Get control of your sheet metal files.
Download the app from matprop.com
Message 4 of 11

Tony_Yates
Advocate
Advocate

Hi Steve,

 

You can do something like this:

 

'Add the below code in your VBA editor


Public Sub MyruleName() '<--- This is what you would tie to a button in a toolbar. This is text on button
RuniLogic "MyruleName" 'This is external ilogic rule
End Sub

 

Public Sub RuniLogic(ByVal RuleName As String)
Dim iLogicAuto As Object
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
If oDoc Is Nothing Then
MsgBox "Missing Inventor Document"
Exit Sub
End If
Set iLogicAuto = GetiLogicAddin(ThisApplication)
If (iLogicAuto Is Nothing) Then Exit Sub
iLogicAuto.RunExternalRule oDoc, RuleName
End Sub

Public Function GetiLogicAddin(oApplication As Inventor.Application) As Object
Dim addIn As ApplicationAddIn
On Error GoTo NotFound
Set addIn = oApplication.ApplicationAddIns.ItemById("{3bdd8d79-2179-4b11-8a5a-257b1c0263ac}")
If (addIn Is Nothing) Then Exit Function
addIn.Activate
Set GetiLogicAddin = addIn.Automation
Exit Function
NotFound:
End Function

 

 

'create a symbol for your new button
'sizes 32x32 and 16x16
' call them MyVBAModule.MyruleName.Large.bmp & MyVBAModule.MyruleName.Small.bmp

 

'create an external rule - MyruleName with this line
iLogicVb.RunRule("Form Controls")

 

'create a local rule in your template "Form Controls" with this line
oRed = iLogicForm.Show("MyFormName", FormMode.NonModal)

 

0 Likes
Message 5 of 11

jedrzej_fiszerMMJKW
Contributor
Contributor

Hey, any solution? I have same task to do.

0 Likes
Message 6 of 11

dalton98
Collaborator
Collaborator

@jedrzej_fiszerMMJKW I think inventor added the ability to do this with global rules and forms recently.

Right click on empty toolbar > Customize User Commands > iLogic Rules

dalton98_0-1695386679864.png

0 Likes
Message 7 of 11

jedrzej_fiszerMMJKW
Contributor
Contributor

Hey, This is not what I need.

 

I'm creating a small form for saving parts with automatic tags and file names, and I'm trying to pin this form window to the interface ribbon - as in the image below.

 

jedrzej_fiszerMMJKW_1-1695390772409.png

This window should always be open.

0 Likes
Message 8 of 11

bradeneuropeArthur
Mentor
Mentor
This is not a form but you will need a dockable window? There are many posts regarding this in special those from @jelte

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

Message 9 of 11

JelteDeJong
Mentor
Mentor

You might want to have a look at this part of my tutorial:

http://www.hjalte.nl/tutorials/69-dockable-window

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 10 of 11

WCrihfield
Mentor
Mentor

I responded to a similar request at the following forum post:

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/how-to-pin-open-form-window-to-the-i... 

Basically just showed the temporary iLogic way of creating a DockableWindow, then launching an iLogic Form, then adding the iLogic Form as the 'Child' of the DockableWindow.  It is a pretty simple process, except for the 'FindWindow' step, which is fairly advanced (and sourced from stackoverflow I believe).  It is certainly not ideal, or the best option, but will work if creating your own add-in for it is not an option.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 11 of 11

Rich-T
Advocate
Advocate

You can always go to 'customize user commands' (right click on your ribbon) and attach a form to the ribbon directly. You don't get a fancy custom icon for your button on the ribbon.

 

Not sure when it was introduced but works in IV2024.

RichT_0-1695784277830.png