AutoCAD P&ID General Discussion

Reply
Contributor
pouria.ghobadi
Posts: 14
Registered: ‎03-30-2012
Message 1 of 7 (674 Views)

Plant 3D API - Opening a project?

674 Views, 6 Replies
06-13-2012 02:04 AM

HI,

How Can I open a plant 3D project with C#

 

I have tried this but it does not work:

 

       string sProject = Path.Combine(ProjectPath.Text , "Project.xml");
       PlantProject oProject = PlantProject.LoadProject(sProject, true, "", "");

 

 

*Expert Elite*
dave.wolfe
Posts: 658
Registered: ‎12-04-2009
Message 2 of 7 (673 Views)

Re: Plant 3D API - Opening a project?

06-13-2012 05:07 AM in reply to: pouria.ghobadi

The best way I've found is to send the commands to the command line (Pinvoke acedCommand) or use LISP.  Set FILEDIA to zero and then you can pass a file name to the OPENPROJECT command.

Dave Wolfe
Isaiah 57:15

ECAD, Inc.
Tips and Tricks on our blog: Process Design, from the Outside

A P3D Authorized Reseller
Contributor
pouria.ghobadi
Posts: 14
Registered: ‎03-30-2012
Message 3 of 7 (671 Views)

Re: Plant 3D API - Opening a project?

06-13-2012 05:46 AM in reply to: dave.wolfe

Thanks for your help, at the moment I am doing the same thing but how can I pass a file name to openproject command programmatically?

*Expert Elite*
dave.wolfe
Posts: 658
Registered: ‎12-04-2009
Message 4 of 7 (668 Views)

Re: Plant 3D API - Opening a project?

06-13-2012 06:16 AM in reply to: pouria.ghobadi

You can build a result buffer and then call acedCommand.

 

http://adndevblog.typepad.com/autocad/2012/04/synchronously-send-and-wait-for-commands-in-autocad-us...

Dave Wolfe
Isaiah 57:15

ECAD, Inc.
Tips and Tricks on our blog: Process Design, from the Outside

A P3D Authorized Reseller
Active Contributor
reactor386
Posts: 27
Registered: ‎01-07-2010
Message 5 of 7 (516 Views)

Re: Plant 3D API - Opening a project?

02-25-2013 02:34 AM in reply to: pouria.ghobadi

Sorry! And haw can I get current project name, if I already opened it?

I need know current project name to load dot net libraries depend project.

And finaly I use LISP to load dot net. So I need LISP way.

*Expert Elite*
dave.wolfe
Posts: 658
Registered: ‎12-04-2009
Message 6 of 7 (509 Views)

Re: Plant 3D API - Opening a project?

02-25-2013 05:33 AM in reply to: reactor386

I haven't seen any of the plant api exposing functions via LISP. So you are much better of using the .Net api directly.  If needed, you can build a dll that references .Net code, and make your own functions exposed to Lisp.

 

You can get project name information by referencing the project part dll in the installation directory.

 

Make sure you install the plant 2013 sdk as well.

Dave Wolfe
Isaiah 57:15

ECAD, Inc.
Tips and Tricks on our blog: Process Design, from the Outside

A P3D Authorized Reseller
Active Contributor
reactor386
Posts: 27
Registered: ‎01-07-2010
Message 7 of 7 (492 Views)

Re: Plant 3D API - Opening a project?

02-26-2013 02:20 AM in reply to: pouria.ghobadi

Thank you for reply! OK I will try to use .Net, but... really... it's too long way opposite simply a couple of LISP strings for this purpose.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

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.

Ask the Community