AutoCAD Plant 3D Forum
Welcome to Autodesk’s AutoCAD Plant 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Plant 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DataLink API !

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
hoangvuminh
1743 Views, 5 Replies

DataLink API !

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 Smiley Surprised

 

Thanx.

5 REPLIES 5
Message 2 of 6
lopezjo
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.

Message 3 of 6
hoangvuminh
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

Message 4 of 6
kgallagherCGHDN
in reply to: lopezjo

where is this comming from Autodesk.ProcessPower.DataObjects?

Message 5 of 6
jabowabo
in reply to: kgallagherCGHDN


@kgallagherCGHDN wrote:

where is this comming from Autodesk.ProcessPower.DataObjects?


Autodesk.ProcessPower.DataLinks.DataLinksManager

Autodesk.ProcessPower.DataObjects.PnPDatabase

Message 6 of 6
kgallagherCGHDN
in reply to: jabowabo

thanks you, i found it a few minutes ago. missing the reference for PNPDataobjects

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost