Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to get all the centerlines per view.
The centerlines are included planes.
I make the user pick the view and then search for all the included centerlines.
My first attemp was with this code:
For Each oCenterline In oSheet.Centerlines
oWF = oCenterline.ModelWorkFeature
Try
If Left(oWF.Name, 3) = "Ref" Then
If oView.GetIncludeStatus(oCenterline) = True
ClArray.Add(oCenterline)
End If
End If
Catch
End Try
Next
But this gave me the wrong number of centerlines (correct amount x 3).
So i made this one now:
Function GetCenterlinesPerView(oView As DrawingView, oSheet As Sheet)
Dim refDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
Dim oPlanes As WorkPlanes = refDoc.ComponentDefinition.WorkPlanes
Dim PlaneArray As New ArrayList
Dim CLArray As New ArrayList
For Each oPlane As WorkPlane In oPlanes
Try
If Left(oPlane.Name, 3) = "Ref" Then
If oView.GetIncludeStatus(oPlane) = True
PlaneArray.Add(oPlane)
End If
End If
Catch
End Try
Next
MessageBox.Show(PlaneArray.Count & " Planes were recognized", "Title")
For Each oCenterline In oSheet.Centerlines
oWF = oCenterline.ModelWorkFeature
If PlaneArray.IndexOf(oWF) > -1 Then
CLArray.Add(oCenterline)
End If
Next
MessageBox.Show(CLArray.Count & " Centerlines were linked", "Title")
'Return ClArray
End Function
The workplane gives me the right number of included features
but when comparing the centerlines to the planes it results in a multiple of 3.
i need the centerline objects per view so i can get its start/endpoint to create sections (with a 150mm offset from the centerline)
Solved! Go to Solution.