Message 1 of 8
iLogic option-Straight VB code: area accepts header statements only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an ilogic rule with the Straight VB code option selected. Now there's an issue with the main sub (See below). The issue says:
"This area accepts header statements only, Such as 'Imports', 'AddReference', 'Option' and others. Ordinary rule code belongs in the lower area."
The thing is, the rule has a header section containing the inports, and the main sub is in the lower area. It doesn't make sense. Do you how to rectify the issue?
Imports System
Imports System.Type
Imports System.Activator
Imports SysInter = System.Runtime.InteropServices
Imports System.IO
Imports Inv = Inventor
'By:
'Date: 10/11/19
Public Sub Main()
MsgBox("Main")
GetDoc()
End Sub
'=\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/==\/=
#Region "Some Sub to Test"
Public Sub GetDoc()
If ThisDoc.Document.Type = Inv.DocumentTypeEnum.kAssemblyDocumentObject Then
MsgBox("Document is an Assembly.")
Else If ThisDoc.Document.Type = Inv.DocumentTypeEnum.kDrawingDocumentObject Then
MsgBox("Document is an Drawing.")
Else If ThisDoc.Document.Type = Inv.DocumentTypeEnum.kPartDocumentObject Then
MsgBox("Document is an Drawing.")
Else
MsgBox("Not a typical document type.")
End If
End Sub
#End Region
