AutoCAD Plant 3D General DIscussion

AutoCAD Plant 3D General DIscussion

Reply
Contributor
11 Posts
0 Kudos
Registered: ‎04-28-2011
Post 1 of 3
Accepted Solution

DataLink API !

470 Views, 2 Replies
06-10-2011 03:28 AM

Hello everyone ,

 

I am having some headache with the DataLinkManager. So that is what i wanna do :

 

- I need to locate the Database and then issue a DataLinkManager but when i call the method getManager(Database) in Visual Basic Express ,  it still said that the "parameter can not be converted to String"  , hmm throug i choose the correct method

 

- Assumed that i do have some Rowids for example 450 , 478 (PnPID) . What i need now is the reference of these rows to the drawings. How can i do that plz help me :smileysurprised:

 

Thanx.

Can you post the code snippet? Hard to help with your specific error without seeing the code but here is a sample of how to get the DataLinksManager from the project in C# (will need to translate it to VB.NET):

 

using Autodesk.ProcessPower.PlantInstance;

using Autodesk.ProcessPower.ProjectManager;

using Autodesk.ProcessPower.DataLinks;

using Autodesk.ProcessPower.DataObjects;

 

    PlantProject proj = PlantApplication.CurrentProject;

    PipingProject prjpart = (PipingProject) proj.ProjectParts["Piping"]; // project is composed of multiple "parts"

 

    DataLinksManager dlm = prjpart.DataLinksManager;

 

Now the dlm variable is a reference to an instance of the data links manager object responsible for ALL drawings of the PipingProject part (i.e. Plant 3D drawings).

 

There are several IDs the DLM can work with:

 

ObjectId - Normal AutoCAD entity ID.

long - Row ID that corresponds to PnPID seen in data manager.

PpObjectid - A combination of AutoCAD Handle identifier and drawing id (PnPID of internal row for drawing)

 

Through the DLM you can perform most activities. If you need to drop to a lower level of abstraction, then from DLM:

 

    PnPDatabase db = dlm.GetPnPDatabase();

 

Now you have access to our database object and can access pretty much anything; be careful of "write" operations at this low level of abstraction as you can easily make mistakes wiring things up breaking data references / relationships. This level of the API only works with "long" row ids.

 

Hope this helps.

Employee
102 Posts
7 Kudos
Registered: ‎07-26-2007
Post 2 of 3

Re: DataLink API !

06-10-2011 09:27 AM in reply to: hoangvuminh

Can you post the code snippet? Hard to help with your specific error without seeing the code but here is a sample of how to get the DataLinksManager from the project in C# (will need to translate it to VB.NET):

 

using Autodesk.ProcessPower.PlantInstance;

using Autodesk.ProcessPower.ProjectManager;

using Autodesk.ProcessPower.DataLinks;

using Autodesk.ProcessPower.DataObjects;

 

    PlantProject proj = PlantApplication.CurrentProject;

    PipingProject prjpart = (PipingProject) proj.ProjectParts["Piping"]; // project is composed of multiple "parts"

 

    DataLinksManager dlm = prjpart.DataLinksManager;

 

Now the dlm variable is a reference to an instance of the data links manager object responsible for ALL drawings of the PipingProject part (i.e. Plant 3D drawings).

 

There are several IDs the DLM can work with:

 

ObjectId - Normal AutoCAD entity ID.

long - Row ID that corresponds to PnPID seen in data manager.

PpObjectid - A combination of AutoCAD Handle identifier and drawing id (PnPID of internal row for drawing)

 

Through the DLM you can perform most activities. If you need to drop to a lower level of abstraction, then from DLM:

 

    PnPDatabase db = dlm.GetPnPDatabase();

 

Now you have access to our database object and can access pretty much anything; be careful of "write" operations at this low level of abstraction as you can easily make mistakes wiring things up breaking data references / relationships. This level of the API only works with "long" row ids.

 

Hope this helps.



Jorge Lopez
Software Architect
Autodesk Plant Solutions
Autodesk, Inc.

Contributor
11 Posts
0 Kudos
Registered: ‎04-28-2011
Post 3 of 3

Re: DataLink API !

06-16-2011 12:35 AM in reply to: lopezjo

........

 

ObjectId - Normal AutoCAD entity ID.

long - Row ID that corresponds to PnPID seen in data manager.

PpObjectid - A combination of AutoCAD Handle identifier and drawing id (PnPID of internal row for drawing)

........

Thanx that was what i am looking for

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 Plant 3D Category!

The AutoCAD Plant 3D 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!