Hey guys thanks for the replies. I've coded a decent bit before, but I've only just started to code in VB and so there's still a lot I don't understand and I totally agree with @Martin-Winkler-Consulting that understanding the actual structure of the language is important. I'm definitely going to do some research and watch some videos on VBs structure.
Moving to my program, I want to establish that I am only working with ILogic rules right now. I am open to using the VBA environment, but would prefer to just stick to ILogic for this program.
Responding to @Anonymous I'm not sure if we have the same definitions for classes and objects. I'm only making one "Station" class but making many objects or instances of that class. The reasoning behind this is that each "Station" object is almost identical, but every one has minor differences. I'm also curious about what you said about ThisRule. I tried to Inherit it but it still didn't fix my issue.
And for @WCrihfield as I said I'm in the ILogic environment but am creating a class in it. As of right now I believe classes are the best solution to having many instances of similar objects but maybe there's a better way? If there isn't a better solution is there a way to inherit all of the inventor functions/snippets/subs/classes into the class so that I can do stuff within the class?
Below is some of my code. It doesn't actually have a station class because I wanted to start these other ones first. They demonstrate a few of the things I want to do. I know it's not super clean or well written as I'm still learning how to write VB classes. If you look BuildTrueSetupList Sub I'm trying to make a list of all of the occurrences in the assembly. It's not possible right now because I can't access ComponentOccurences. There's some other things but this is one example.
Sub Main
Dim Props As New SetupProperties(Parameter, MultiValue)
Props.BuildLists
End Sub
Class BaseProperties
'###FIELDS###
Dim Parameter As IParamDynamic
Dim MultiValue As IMultiValueParam
Public ConstantsList As New List(Of String)
Public Count As Integer = 0
'###CONSTRUCTOR###
Public Sub New(oParam As IParamDynamic,multival As IMultiValueParam)
Parameter = oParam
MultiValue = multival
End Sub
'###METHODS###
Public Sub BaseCurrent()
BuildBaseModelList()
End Sub
Public Sub Update()
Parameter("Frame:1", "Width") = Parameter("Width")
Parameter("Frame:1", "Pitch") = Parameter("Pitch")
Parameter("Frame:1", "WidthCnt") = Parameter("WidthCount")
Parameter("Frame:1", "LengthCnt") = Parameter("LengthCount")
Parameter("Frame:1", "Count") = Count
Parameter("Frame:1", "Spacing") = 10
End Sub
Private Sub BuildBaseModelList()
oFolder = ThisApplication.ActiveDocument.BrowserPanes("Model").TopNode.BrowserFolders.Item("Base")
Dim oItem As BrowserNode
For Each oItem In oFolder.BrowserNode.BrowserNodes
ConstantsList.Add(oItem.NativeObject.Name)
Next
End Sub
End Class
Class SetupProperties
Inherits BaseProperties
Private TrueSetup As List(Of String)
Public Sub New(oParam As IParamDynamic,multival As IMultiValueParam)
MyBase.New(oParam,multival)
End Sub
Public Sub BuildLists()
BaseCurrent
BuildTrueSetupList
End Sub
Private Sub BuildTrueSetupList()
Dim oComp As ComponentOccurrence
Dim oComps As ComponentOccurrences
oComps = ThisDoc.Document.ComponentDefinition.Occurrences
For Each oComp In oComps
If Not ConstantsList.Contains(oComp.Name)
TrueSetup.Add(oComp.Name)
End If
Next
End Sub
End Class
Sorry that was so long winded but at the end of the day if there's an "Inherit 'Something'" line that I can add to the top of the classes which would give me access to all the ILogic stuff that's what I'm looking for. Thank you again!