• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD P&ID

    Reply
    Contributor
    Posts: 12
    Registered: ‎03-30-2012

    Plant 3D API - Opening a project?

    471 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, "", "");

     

     

    Please use plain text.
    *Expert Elite*
    dave.wolfe
    Posts: 474
    Registered: ‎12-04-2009

    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
    Please use plain text.
    Contributor
    Posts: 12
    Registered: ‎03-30-2012

    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?

    Please use plain text.
    *Expert Elite*
    dave.wolfe
    Posts: 474
    Registered: ‎12-04-2009

    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
    Please use plain text.
    Contributor
    Posts: 22
    Registered: ‎01-07-2010

    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.

    Please use plain text.
    *Expert Elite*
    dave.wolfe
    Posts: 474
    Registered: ‎12-04-2009

    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
    Please use plain text.
    Contributor
    Posts: 22
    Registered: ‎01-07-2010

    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.

    Please use plain text.