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

Plant 3D 2013: PnPID - Export / PnPID in data manager different

3 REPLIES 3
Reply
Message 1 of 4
lars.siegling
867 Views, 3 Replies

Plant 3D 2013: PnPID - Export / PnPID in data manager different

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:

msgbox.JPG

 

 

Screenshot of the data manager:

 

datamanager.JPG

 

 

 

 

 

 

How can I get the PnPID shown in the data manager.

 

Thank you,

Lars

 

3 REPLIES 3
Message 2 of 4

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?

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 3 of 4

Hi,

 

thanks for your help. Yes, I'm sure to get the correct object. Do have used my sourcecode?

 

Regards,

Lars

Message 4 of 4

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?

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