<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic P&amp;amp;ID custom data. in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/p-amp-id-custom-data/m-p/3877067#M49902</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the best way to transfer custom data from a P&amp;amp;ID object to the corresponding Plant 3D object?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My scenario is:&lt;BR /&gt;I've added custom data to P&amp;amp;ID objects.&lt;/P&gt;&lt;P&gt;When the user uses the P&amp;amp;ID Line List to place a part from P&amp;amp;ID schematic I want to add my&amp;nbsp;custom data from the P&amp;amp;ID object to the placed part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I've been playing with something like this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get the line number from the selected Plant 3D object.&lt;BR /&gt;PlantProject project = PlantApplication.CurrentProject;&lt;BR /&gt;PipingProject pipeProj = (PipingProject)project.ProjectParts["Piping"];&lt;BR /&gt;DataLinksManager dlm = pipeProj.DataLinksManager;&lt;/P&gt;&lt;P&gt;int rowId = dlm.FindAcPpRowId(objId);&lt;BR /&gt;PnPRowIdArray relatedIds = dlm.GetRelatedRowIds("P3dLineGroupPartRelationship", "Part", rowId, "LineGroup");&lt;BR /&gt;int lgRowId = relatedIds.First.Value;&lt;BR /&gt;PnPRow lgRow = dlm.GetPnPDatabase().GetRow(lgRowId);&lt;BR /&gt;string ln = lgRow["Number"].ToString();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get the components in the LineGroup from the PnIdProject&lt;BR /&gt;PnIdProject pnIdProj = (PnIdProject)project.ProjectParts["PnId"];&lt;BR /&gt;DataLinksManager dlmPnId = pnIdProj.DataLinksManager;&lt;BR /&gt;PnPDatabase pnpDb = dlmPnId.GetPnPDatabase();&lt;BR /&gt;PnPTable table = pnpDb.Tables["PipeLineGroup"];&lt;BR /&gt;PnPRow[] rows = table.Select(String.Format("LineNumber={0}", ln));&lt;BR /&gt;PnPRowIdArray components = dlmPnId.GetRelatedRowIds("PipeLineGroupRelationship", "PipeLineGroup", rows[0].RowId, "PipeLine");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get custom data from components...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;//Annse&lt;/P&gt;</description>
    <pubDate>Sun, 21 Apr 2013 07:08:54 GMT</pubDate>
    <dc:creator>annse</dc:creator>
    <dc:date>2013-04-21T07:08:54Z</dc:date>
    <item>
      <title>P&amp;ID custom data.</title>
      <link>https://forums.autodesk.com/t5/net-forum/p-amp-id-custom-data/m-p/3877067#M49902</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the best way to transfer custom data from a P&amp;amp;ID object to the corresponding Plant 3D object?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My scenario is:&lt;BR /&gt;I've added custom data to P&amp;amp;ID objects.&lt;/P&gt;&lt;P&gt;When the user uses the P&amp;amp;ID Line List to place a part from P&amp;amp;ID schematic I want to add my&amp;nbsp;custom data from the P&amp;amp;ID object to the placed part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I've been playing with something like this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get the line number from the selected Plant 3D object.&lt;BR /&gt;PlantProject project = PlantApplication.CurrentProject;&lt;BR /&gt;PipingProject pipeProj = (PipingProject)project.ProjectParts["Piping"];&lt;BR /&gt;DataLinksManager dlm = pipeProj.DataLinksManager;&lt;/P&gt;&lt;P&gt;int rowId = dlm.FindAcPpRowId(objId);&lt;BR /&gt;PnPRowIdArray relatedIds = dlm.GetRelatedRowIds("P3dLineGroupPartRelationship", "Part", rowId, "LineGroup");&lt;BR /&gt;int lgRowId = relatedIds.First.Value;&lt;BR /&gt;PnPRow lgRow = dlm.GetPnPDatabase().GetRow(lgRowId);&lt;BR /&gt;string ln = lgRow["Number"].ToString();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get the components in the LineGroup from the PnIdProject&lt;BR /&gt;PnIdProject pnIdProj = (PnIdProject)project.ProjectParts["PnId"];&lt;BR /&gt;DataLinksManager dlmPnId = pnIdProj.DataLinksManager;&lt;BR /&gt;PnPDatabase pnpDb = dlmPnId.GetPnPDatabase();&lt;BR /&gt;PnPTable table = pnpDb.Tables["PipeLineGroup"];&lt;BR /&gt;PnPRow[] rows = table.Select(String.Format("LineNumber={0}", ln));&lt;BR /&gt;PnPRowIdArray components = dlmPnId.GetRelatedRowIds("PipeLineGroupRelationship", "PipeLineGroup", rows[0].RowId, "PipeLine");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get custom data from components...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;//Annse&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2013 07:08:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/p-amp-id-custom-data/m-p/3877067#M49902</guid>
      <dc:creator>annse</dc:creator>
      <dc:date>2013-04-21T07:08:54Z</dc:date>
    </item>
  </channel>
</rss>

