Question

This is what solidworks tells you to do to reference swApp, but I keep getting NullReferenceException on the line that it is referenced.

Does anyone have any idea why? or How I go about repairing?

Can I reference it later on such as swApp = ????

private void button5_Click(object sender, EventArgs e)
{
    //Save Drawing
    ModelDoc2 swDoc = null;
    int longstatus = 0;
    swDoc = ((ModelDoc2)(swApp.ActiveDoc));
    longstatus = swDoc.SaveAs3(
            @"C:\Engineering\Engineering\SW Automation\Linear Actuator Technology\MLD Series\Prints\Configured Prints\" + 
            textBox1.Text + ".SLDDRW", 0, 2);
}

public SldWorks swApp;

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top