AutoCAD P&ID General Discussion

AutoCAD P&ID General Discussion

Reply
*Expert Elite*
204 Posts
44 Kudos
Registered: ‎05-19-2011
Post 11 of 13

Re: Silent ExportToAutoCAD command

04-06-2012 05:15 AM in reply to: derek.jarvis

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.

If my post answers your question, please click the "Accept as Solution" button.

Check out my blog http://lazcad.com
*Expert Elite*
204 Posts
44 Kudos
Registered: ‎05-19-2011
Post 12 of 13

Re: Silent ExportToAutoCAD command

04-08-2012 06:07 PM in reply to: Rave.Tam

Something like this

 

foreach (string file in filePath.ToList())
{
ExportDrawing(file);
}

 

ExportDrawing method below

 

var doc = Application.DocumentManager.Open(file, true);
var db = doc.Database;
Application.DocumentManager.MdiActiveDocument = doc;

using (doc.LockDocument())
{
if (counter < maxCounter)
{
Core.PostCmd("ExportToAutoCAD" + "\n");
counter++;
}

Core.PostCmd("-ExportToAutoCAD 2010 " + localFile + "\n");

 

If my post answers your question, please click the "Accept as Solution" button.

Check out my blog http://lazcad.com
Active Member
10 Posts
0 Kudos
Registered: ‎09-07-2011
Post 13 of 13

Re: Silent ExportToAutoCAD command

04-13-2012 10:19 AM in reply to: Rave.Tam

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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD P&ID Category!

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.

Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!