.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

P&ID custom data.

0 REPLIES 0
Reply
Message 1 of 1
annse
408 Views, 0 Replies

P&ID custom data.

Hi!

 

What would be the best way to transfer custom data from a P&ID object to the corresponding Plant 3D object?

 

My scenario is:
I've added custom data to P&ID objects.

When the user uses the P&ID Line List to place a part from P&ID schematic I want to add my custom data from the P&ID object to the placed part.

 

So far I've been playing with something like this...

 

//Get the line number from the selected Plant 3D object.
PlantProject project = PlantApplication.CurrentProject;
PipingProject pipeProj = (PipingProject)project.ProjectParts["Piping"];
DataLinksManager dlm = pipeProj.DataLinksManager;

int rowId = dlm.FindAcPpRowId(objId);
PnPRowIdArray relatedIds = dlm.GetRelatedRowIds("P3dLineGroupPartRelationship", "Part", rowId, "LineGroup");
int lgRowId = relatedIds.First.Value;
PnPRow lgRow = dlm.GetPnPDatabase().GetRow(lgRowId);
string ln = lgRow["Number"].ToString();

 

//Get the components in the LineGroup from the PnIdProject
PnIdProject pnIdProj = (PnIdProject)project.ProjectParts["PnId"];
DataLinksManager dlmPnId = pnIdProj.DataLinksManager;
PnPDatabase pnpDb = dlmPnId.GetPnPDatabase();
PnPTable table = pnpDb.Tables["PipeLineGroup"];
PnPRow[] rows = table.Select(String.Format("LineNumber={0}", ln));
PnPRowIdArray components = dlmPnId.GetRelatedRowIds("PipeLineGroupRelationship", "PipeLineGroup", rows[0].RowId, "PipeLine");

 

//Get custom data from components...

 

Thanks!

//Annse

0 REPLIES 0

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost