AutoCAD P&ID General Discussion

AutoCAD P&ID General Discussion

Reply
Active Member
derek.jarvis
Posts: 10
Registered: ‎09-07-2011
Message 1 of 7 (374 Views)

API for saving drawings to AutoCAD

374 Views, 6 Replies
03-29-2012 10:28 AM

Is there something available in the API (or the command line) to automate the export of P&IDs from AutoCAD P&ID to the vanilla AutoCAD version?

Product Support
jason.drew
Posts: 323
Registered: ‎06-17-2010
Message 2 of 7 (368 Views)

Re: API for saving drawings to AutoCAD

03-29-2012 01:53 PM in reply to: derek.jarvis

Currently there is not a "batch export" of any sort for P&ID.

 

That would require some API programming starting with "Resave all project drawings", then opening each drawing one by one, executing the EXPORTTOAUTOCAD command, and finally inserting the path where the exported DWGs are going to.

 

I will submit this as a feature request to the product team.

 

Thank you,

 



Jason Drew
Premium Support Specialist
Product Support
Autodesk, Inc.





If my post answers your question, please click the "Accept as Solution" button. This helps everyone find answers more quickly.
Active Member
derek.jarvis
Posts: 10
Registered: ‎09-07-2011
Message 3 of 7 (364 Views)

Re: API for saving drawings to AutoCAD

03-29-2012 02:14 PM in reply to: jason.drew

Thank you for your response.

 

Have I interpreted correctly to assume that there is currently no API function to save a drawing to AutoCAD, and that this must be done through the "exportToAutocad" command?

 

Are there any API examples of opening / closing project drawings?

Product Support
jason.drew
Posts: 323
Registered: ‎06-17-2010
Message 4 of 7 (330 Views)

Re: API for saving drawings to AutoCAD

04-04-2012 01:31 PM in reply to: derek.jarvis

Correct, to save as a "regular" AutoCAD drawing (where the symbols are converted to standard blocks and the annotations converted to attributed blocks) the proper method is to open the drawing, save it, then you can right-click and use "Export to AutoCAD"

 

You can still open an AutoCAD P&ID DWG in regular AutoCAD, but the objects will be proxy objects and you won't be able to display all of the properties in the properties window. Exporting would allow someone with regular ACAD to view all the properties as attributes of the symbol and annotation blocks.

 

Also, exporting would be recommended method for final delivery where you wouldn't want someone to have the ability to bring that DWG right back into AutoCAD P&ID. It's essentially a "dumb" P&ID after exporting.

 

On batch exporting, I would recommend posting the question on one of the customization forums here:

 

http://forums.autodesk.com/t5/AutoCAD-Customization/ct-p/1002

 

If it can't be accomplished through Visual LISP or AutoLISP, I would say you would need the Plant 3D SDK (software development kit) along with Visual Basic or Visual C# in order to write code to perform this from within the API.

 

Thank you,

 

 



Jason Drew
Premium Support Specialist
Product Support
Autodesk, Inc.





If my post answers your question, please click the "Accept as Solution" button. This helps everyone find answers more quickly.
Active Member
derek.jarvis
Posts: 10
Registered: ‎09-07-2011
Message 5 of 7 (317 Views)

Re: API for saving drawings to AutoCAD

04-06-2012 01:44 PM in reply to: jason.drew

I have the Plant 3D SDK and would love to use a .Net solution to this problem. Unfortunately, I can't seem to find an API command to export the drawing to plain AutoCAD. Can you point me in the right direction?

*Expert Elite*
Rave.Tam
Posts: 204
Registered: ‎05-19-2011
Message 6 of 7 (310 Views)

Re: API for saving drawings to AutoCAD

04-08-2012 06:07 PM in reply to: derek.jarvis

check this post

http://forums.autodesk.com/t5/AutoCAD-P-ID/Silent-ExportToAutoCAD-command/m-p/3404431#M3395

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

Check out my blog http://lazcad.com
Active Member
derek.jarvis
Posts: 10
Registered: ‎09-07-2011
Message 7 of 7 (290 Views)

Re: API for saving drawings to AutoCAD

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

Thanks for your reply.

 

I have managed to get the script solutions working, but I was hoping for an API solution to avoid having to open/close all the drawings in the editor.

 

Thanks to all who contributed to this post.

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 Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!