Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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!
Solved! Go to Solution.