Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

@MechMachineMan

 

That's nice information.

 

@martinhoos,

 

Try the below VBA code to run rule if the answer is yes.

 

Sub Stl_Export_LN()

If MsgBox("Möchtest Du eine Plausibilitaetsprüfung?", vbYesNo + vbQuestion) = vbYes Then
	RuniLogic ("Plausibilitaetsprüfung")
End If

.........
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

Function GetiLogicAddin(oApplication As Inventor.Application) As Object
  Dim addIns As ApplicationAddIns
  Set addIns = oApplication.ApplicationAddIns

  Dim addIn As ApplicationAddIn
  Dim customAddIn As ApplicationAddIn
  For Each addIn In addIns
    If (addIn.ClassIdString = "{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}") Then
        Set customAddIn = addIn
        Exit For
    End If
  Next
 
  Set GetiLogicAddin = customAddIn
End Function

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network