Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
A.Acheson
in reply to: breinkemeyer

Hi @breinkemeyer 

Yes that would be a good way to tie a centerline to the model. You can also project a curve into the sketch and constrain the line to that curve. 

 

Here is a quick sample in VB.NET of just adding a sketchline and changing layer to Centerline. 

Dim drawView As DrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a drawing view")

Dim drawDoc As DrawingDocument= ThisApplication.ActiveDocument

Dim sketch1 As DrawingSketch = drawView.Sketches.Add   
sketch1.Edit

Dim startPt As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(0,0)
startPt = drawView.SheetToDrawingViewSpace(startPt)

Dim endPt As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(216*2.54,0)
endPt = drawView.SheetToDrawingViewSpace(endPt)

Dim oLine As SketchLine = sketch1.SketchLines.AddByTwoPoints(startPt, endPt)
Dim layers As LayersEnumerator = drawDoc.StylesManager.Layers
oLine.Layer = layers.Item("Centerline (ANSI)")
sketch1.ExitEdit

 

This isn't tied to any specific geometry, the centerline is just of the sheet. 

AAcheson_0-1713375332876.png

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan