Plant 3D API - "Rotation" of a Structual Column ?

Plant 3D API - "Rotation" of a Structual Column ?

MarkSanchezSPEC
Advocate Advocate
724 Views
2 Replies
Message 1 of 3

Plant 3D API - "Rotation" of a Structual Column ?

MarkSanchezSPEC
Advocate
Advocate

I have selected two Structure members (see attachment) and am trying to obtain the "rotation" or "Angle" of each column. When drawing them manually, I specified an "Angle" of 0 or 90 degrees for these members, which gave them the appearances shown.

 

How would I programmatically obtain the angle of each member? Thus far I have iterated thru the properties obtained from the DataLinksManager and can get the Entity object but nowhere do I see and Angle or Orientation property. Here's my code:

 

Dim tv(0) As TypedValue
tv(0) = New TypedValue(0, "ACPPSTRUCTUREBEAM")
Dim selFil As New SelectionFilter(tv)

Dim ed As Editor = acApp.DocumentManager.MdiActiveDocument.Editor
ed.WriteMessage("\nSelect structural members: ")
Dim pRes As PromptSelectionResult = ed.GetSelection(selFil)

If Not IsNothing(pRes.Value) Then
        Dim oPrj As PipingProject = PlantApplication.CurrentProject.ProjectParts("Piping")
        Dim dlm As DataLinksManager = oPrj.DataLinksManager

        Dim objID As ObjectId = Nothing
        Dim objIDs() As ObjectId = pRes.Value.GetObjectIds
        For obj As Short = 0 To objIDs.Length - 1

              objID = objIDs(obj)
              Dim props As List(Of KeyValuePair(Of String, String)) = dlm.GetAllProperties(objID, True)
              Dim sKey As String = String.Empty, sVal As String = String.Empty

              Using tr As Transaction = db.TransactionManager.StartTransaction
                  Dim ent As Entity = tr.GetObject(objID, OpenMode.ForRead)
'TRYING TO GET ANGLE VIA Entity...
              End Using

             For i As Short = 0 To props.Count - 1
                  sKey = props(i).Key
                  sVal = props(i).Value
                  Debug.Print(sKey + ":" + sVal)
 'TRYING TO GET ANGLE VIA THESE PROPERTIES...
              Next
End If

Cheers!

0 Likes
Accepted solutions (1)
725 Views
2 Replies
Replies (2)
Message 2 of 3

jabowabo
Mentor
Mentor
Accepted solution
Unfortunately, there is no access to structural members through the API. You can get some info from the P3D structural data table but not rotation.
Message 3 of 3

MarkSanchezSPEC
Advocate
Advocate

Oh, that's right! I've been learning both Plant 3D and Revit here and did come across that fact a while back. Thanks for the answer.

 

Cheers!

0 Likes