Message 1 of 8
running ilogic form forms (exe)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have this problem .. I have a lot of ilogic files i want to run form a forms (Exe). but the problem is that all the ilogic files work .. if you run them ,,, or by aktivet form VBA Form... and run by marco .. but for some reason they do not work if I run them form a form in exe program. well some do ... but not all ...and it even not the same error that pops op
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim invApp As Inventor.Application
invApp = GetObject(, "Inventor.Application")
Dim addIn As ApplicationAddIn
Dim addIns As ApplicationAddIns
addIns = invApp.ApplicationAddIns
For Each addIn In addIns
If InStr(addIn.DisplayName, "iLogic") > 0 Then
addIn.Activate()
Dim iLogicAuto As Object
iLogicAuto = addIn.Automation
Exit For
End If
Next
'Debug.Print(addIn.DisplayName)
'Dim RuleName1 As String
Dim EXTERNALrule
EXTERNALrule = "Exportdatatocalworksheet"
'Dim RuleName2 As String
'INTERNALrule = "Rule2"
Dim oDoc As Document
oDoc = invApp.ActiveDocument
If oDoc Is Nothing Then
MsgBox("Missing Inventor Document")
Exit Sub
End If
Dim iLogicAuto2 = addIn.Automation
iLogicAuto2.RunExternalRule(oDoc, EXTERNALrule) 'for external rule
End Sub
this code give me error
Current thread must be set to single thread apartment (STA)
I do not get it ... the Ilogic codes should be ok ... we have use them for a long time ... what i just need to do is hit a buttom and run a ilogic code in inventor .... can anyone tell me why that is soo hard?...and and why some code run fine as normal ... som does not work