06-20-2024
07:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-20-2024
07:41 AM
See example, and updates in blue.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Sub Main Dim oDoc As DrawingDocument = ThisDoc.Document Dim oSheet As Sheet = oDoc.ActiveSheet Dim oView As DrawingView = oSheet.DrawingViews.Item(1) ' Assuming you're working with the first view ' Get the lowest Y position of all dimensions on the drawing sheet Dim lowestY As Double = GetLowestDimensionY(oSheet) ' Get the label associated with the view Dim oLabel As DrawingViewLabel = oView.Label ' Define the new position for the label Dim newX As Double = oLabel.Position.X Dim newY As Double = lowestY - 1 ' Adjust this value as needed for spacing Dim oPoint As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(newX, newY) ' Move the label to the new position oLabel.Position = oPoint ' Refresh the drawing to see the changes oSheet.Update() End Sub Function GetLowestDimensionY(sheet As Sheet) As Double Dim lowestY As Double = Double.MaxValue For Each oDim As GeneralDimension In sheet.DrawingDimensions Dim dimPosition As Point2d = oDim.Text.Origin Dim dimY As Double = dimPosition.Y If dimY < lowestY Then lowestY = dimY End If Next Return lowestY End Function