I can't get my design table to modify when opened the line I am having the trouble is var sheet = (Excel._Worksheet)swDoc.GetDesignTable; . Essentially what I want it to do is open the window and reference the active sheet which is the "Design Table". The API does include "DesignTable" as type. I have been stuck for a while. Any help is appreciated.
//Open Solidworks Design Table
//My way around the Csharp Add in
SldWorks swApp;
swApp = null;
swApp = (SldWorks)Activator.CreateInstance(Type.GetTypeFromProgID("SldWorks.Application"));
//Macro Generated
ModelDoc2 swDoc = null;
bool boolstatus = false;
swDoc = ((ModelDoc2)(swApp.ActiveDoc));
boolstatus = swDoc.Extension.SelectByID2("Design Table", "DESIGNTABLE", 0, 0, 0, false, 0, null, 0);
swDoc.InsertFamilyTableEdit();
ModelView myModelView = null;
myModelView = ((ModelView)(swDoc.ActiveView));
myModelView.FrameState = ((int)(swWindowState_e.swWindowMaximized));
var sheet = (Excel._Worksheet)swDoc;
//Generate Linear Guide Support in Solidworks
if (comboBox1.Text == "0")//No External Rails
{
sheet.Cells[6, 4] = "0"; //Cell Location [y-axis, x-axis]
}
else if (comboBox1.Text == "1") //(1) Rail, (1) Runner Block - XY-2 Brkt (R)
{
sheet.Cells[6, 4] = "1";
}
//Close Design Table
swDoc.CloseFamilyTable();
SolidworksApi macros