04-17-2024
10:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-17-2024
10:38 AM
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.
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan
Or if this helped you, please, click (like)
Regards
Alan