Hi.
Do you want it as a button on the ribbon?
Place the iLogic-code as a External rule. Save it as a .txt (notepad) document.
(I cant convert it to VBA)
Place this code in a Module in the VBA-editor.
Public Sub Dimensions()
RuniLogic ("Your iLogic code.txt") 'replace the red text with the name of your external 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
You can now add the a button to the ribbon. Right-click on the ribbon and select "Customaize User Commands"

The macroname will be Dimensions
//Jesper
//Jesper
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.