Hello everyone,
we have to export the parts of a P&ID Drawing with there PnPID as shown in the data manager. The exported PnPID is different from the pnPID in the data manager.
For example one of this parts has in the data manager the PnPID=6704. When I export the part with the following code I get the PnPID=16
<CommandMethod("TestPnPID")> _ Public Sub TestPnPID() Dim myDb As Database = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database Dim myDlm As DataLinksManager = DataLinksManager.GetManager(myDb) Dim myProject As Project = PlantApplication.CurrentProject.ProjectParts("PnId") Dim myProjectDrawings As List(Of PnPProjectDrawing) = myProject.GetPnPDrawingFiles() Dim sProperties As String = String.Empty Dim myRowIDs As Autodesk.ProcessPower.DataObjects.PnPRowIdArray = myDlm.SelectAcPpRowIds(myDb) For Each myRowID As Integer In myRowIDs Dim myProperties As List(Of KeyValuePair(Of String, String)) = myDlm.GetAllProperties(myRowID, True) For Each myProperty As KeyValuePair(Of String, String) In myProperties If myProperty.Key.ToUpper = "PNPID" Or myProperty.Key.ToUpper = "CLASSNAME" Then sProperties = sProperties & myProperty.Key.ToUpper & ":" & myProperty.Value End If Next sProperties = sProperties & vbNewLine Next MsgBox(sProperties) End Sub
Screenshot of the msgbox:
Screenshot of the data manager:
How can I get the PnPID shown in the data manager.
Thank you,
Lars
Hi,
Not sure if I understood your question... but when I try GetAllProperties, the first property of the list is PnPID with the same number as shown on the Data Links Manager. Am I missing anything? Are you sure you're getting the correct object?
Hi,
thanks for your help. Yes, I'm sure to get the correct object. Do have used my sourcecode?
Regards,
Lars
Hi Augusto,
I'm trying to load a mass number of tags and I'm looking for a way to do it without having to create geometry or blocks to create associated PnPID numbers. In theory, could I add a list of components in my exported database and bring them back in when I import the database back in? Is there a way of creating manual PnPID numbers?