i'm invoking the dialog box the first time by using acedpostcommand to send a "exporttoautocad" command. the user will cancel the dialog box, and the script would run. its a simple open drawing (using document manager), then send the command -exporttoautocad and close the drawing. No p&id command needed. This works for both Plant3D model and P&ID drawing.
Something like this
foreach (string file in filePath.ToList())
ExportDrawing method below
var doc = Application.DocumentManager.Open(file, true);
var db = doc.Database;
Application.DocumentManager.MdiActiveDocument = doc;
if (counter < maxCounter)
Core.PostCmd("ExportToAutoCAD" + "\n");
Core.PostCmd("-ExportToAutoCAD 2010 " + localFile + "\n");
Thank you for your response.
While this is the same snippet that I've seen for LISP / Script files, I did finally find my problem. For some reason, some of my drawings had a different prompt for the export command, and I think it's because they needed to be audited/recovered.
I used this on a test project and it worked fine.
Thanks again for your help.
Access a broad range of knowledge to help get the most out of your products and services.
Start with some of our most frequented solutions to get help installing your software.
The AutoCAD P&ID forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.