Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've searched on the forums and I found back in 2005 that it wasn't possible to move the end points/start points. I'm curious if anything has changed. I know it's possible to move it manually.
Below I'm trying to move the start/end point of a centerline on a drawing. If anyone has any tips I'd appreciate it.
Public Sub MoveCenterlinePoints()
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Set oSheet = oDrawDoc.ActiveSheet
Dim oCenterline As Centerline
Dim oWFeatureName As String
Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry
Dim oPt2D As Point2d
Dim oCenterLinePt2D As Point2d
Dim strPointPos As String
For Each oCenterline In oSheet.Centerlines
oWFeatureName = oCenterline.ModelWorkFeature.Name
If oWFeatureName <> "XY Plane" And oWFeatureName <> "YZ Plane" And oWFeatureName <> "XZ Plane" Then
If oCenterline.StartPoint.X / 2.54 = oCenterline.EndPoint.X / 2.54 Then
If oCenterline.StartPoint.Y / 2.54 > oCenterline.EndPoint.Y / 2.54 Then
strPointPos = "START"
Else
strPointPos = "END"
End If
Else
If oCenterline.StartPoint.X / 2.54 < oCenterline.EndPoint.X / 2.54 Then
strPointPos = "START"
Else
strPointPos = "END"
End If
End If
End If
If strPointPos = "START" Then
Set oCenterLinePt2D = oCenterline.StartPoint
Set oCenterLinePt2D = oTG.CreatePoint2d(100, 100)
Else
Set oCenterLinePt2D = oCenterline.EndPoint
Set oCenterLinePt2D = oTG.CreatePoint2d(100, 100)
End If
Next
End Sub
Tiffany Hayden
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Solved! Go to Solution.