As the title says I am trying to get data from a general table.
Dim myModelView As Object
Dim myTable As Object
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set myModelView = Part.ActiveView
myModelView.FrameState = swWindowState_e.swWindowMaximized
boolstatus = Part.Extension.SelectByID2("DetailItem#@<sheet name>", "ANNOTATIONTABLES", 0, 0, 0, False, 0, Nothing, 0)
Set myTable = Part.SelectionManager.GetSelectedObject5(1)
myTable.Text(1, 0) = "test"
The above code works. The trouble I am running into is determining the item#.
This will find the table in the feature tree but results in a error when attempting to use .Text()
boolstatus = Part.Extension.SelectByID2("WPS@<sheet name>", "GENERALTABLEFEAT", 0, 0, 0, False, 0, Nothing, 0)
What would be the best way to achieve this?
You can use this example which shows how to select table by name: 2015 SOLIDWORKS API Help - Get General Table Feature Example (VBA) and this example reads the content of the selected table into an array: Read Table Content Into Array
Retrieving data ...