Save in AcCoreConsole

Save in AcCoreConsole

wesbird
Collaborator Collaborator
846 Views
2 Replies
Message 1 of 3

Save in AcCoreConsole

wesbird
Collaborator
Collaborator

Hi, 

 

  I plan to migrate some functions from AutoCAD to AcCoreConsole. now I have to problem to save the drawing. 

 

  here is the original code works in AutoCAD, I cannot make it compile with AcCoreConsole. I think it must be related to AcMgd.dll. 

 

AcadDocument acadDoc = DocumentExtension.GetAcadDocument(Active.Document) as AcadDocument;
acadDoc.Invoke("Save", new object[0]);

 

  so I change the code to: 

 

Application.DocumentManager.MdiActiveDocument.Database.SaveAs(fileName, version);

 

  then I got error message:

 

eFileSharingViolation

 

 after this change code to:

 

Active.Database.Save();

 

  then error message change to

 

eFileInternalErr

 

  What should I do? 

 

 

Thank you so much for your help 

Wes

Windows 10 64 bit, AutoCAD (ACA, Map) 2023
0 Likes
847 Views
2 Replies
Replies (2)
Message 2 of 3

jeff
Collaborator
Collaborator

You cant use any any functions defined in Acmgd.dll assembly with core console. Only Accoremgd.dll and AcDbMgd.dll with core console.

 

The eaisest way would be to remove reference to Acmgd.dll so you be sure it will work with core console.

 

 

You can also find your answers @ TheSwamp
0 Likes
Message 3 of 3

Anonymous
Not applicable

So, from what I understand acCodeConsole would save the dwg file automatically when the script ends?

Would also terminate itself or should I kill the process?

 

What if I want to perform operations that don't require a file save, like a plot. May I instruct acCoreConsole to exit without saving? Saving large drawings can be very time consuming...

 

Just moving my first steps with acCoreConsole... too bad there is still no documentation after almost two years from its presentation to the community...

The fear here is to invest lot of time and maybe this feature will be completely changed or even removed...

0 Likes