I have the eFileAccessError when running a custom code using the netload command to load the .dll file after starting AutoCAD Electrical.
![TXACDE24_1-1717673130505.png TXACDE24_1-1717673130505.png](https://forums.autodesk.com/t5/image/serverpage/image-id/1372710i9C02EB5BED45B6D9/image-size/medium?v=v2&px=400)
However, the same code runs well when in visual studio debugging mode starting AutoCAD Electrical as an external program.
![TXACDE24_0-1717673113735.png TXACDE24_0-1717673113735.png](https://forums.autodesk.com/t5/image/serverpage/image-id/1372709iAD7E1580709B17A4/image-size/medium?v=v2&px=400)
Below is the code to save to dwg files.
//assign file name and determine if its is named
string strDWGName = acDoc.Name;
object obj = Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("DWGTITLED");
// Check to see if the drawing has been named
if (System.Convert.ToInt16(obj) == 0)
{
// If the drawing is using a default name (Drawing1, Drawing2, etc)
// then provide a new name
strDWGName = $"{symbol.Name}.dwg";
}
try
{
acCurDb.SaveAs(strDWGName, true, DwgVersion.Current, acDoc.Database.SecurityParameters);
}
catch (System.Exception e)
{
MessageBox.Show(e.Message);
}