Message 1 of 12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dim doc As PartDocument = ThisApplication.ActiveDocument
Dim sk As Sketch = doc.ComponentDefinition.Sketches.Item(doc.ComponentDefinition.Sketches.Count)
If sk.SketchLines.Count > 0 Then
For Each line As SketchLine In sk.SketchLines
Dim startPoint As Point2d = Line.StartSketchPoint.Geometry
Dim endPoint As Point2d = Line.EndSketchPoint.Geometry
Dim centerPoint As Point2d = ThisApplication.TransientGeometry.CreatePoint2d((startPoint.X + endPoint.X) / 2, (startPoint.Y + endPoint.Y) / 2)
sk.SketchPoints.Add(centerPoint)
Next
doc.Update2()
Else
MsgBox("No se encontraron líneas en el boceto.")
End If
Hi Everybody, I have this code to create a point in the middle of the lines in an active sketch. I need to put UCS on the created center point, I've tried but always get an error.
Solved! Go to Solution.