Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been writing a script to change the position of the dimension text, but it's not working as expected. Can anyone tell me why and how it might work?
P.S. I set the dimension text to the center position (it works) and after that try to move it by changing the X and Y coordinates (it doesn't work).
Sub ChangeDimTextPosition(DimName As String, DimX As Double, DimY As Double) Dim oDoc As DrawingDocument = ThisDoc.Document Dim oSheets As Sheets = oDoc.Sheets Dim oViews As DrawingViews Dim oName As String Dim oCoords() As Double = {0,0} For Each oSheet As Sheet In oSheets oSheet.Activate oViews = oDoc.ActiveSheet.DrawingViews For Each oView As DrawingView In oViews ViewName = oView.Name For Each oDim As DrawingDimension In oSheet.DrawingDimensions If oDim.Retrieved Then oName = oDim.RetrievedFrom.Parameter.Name Else oName = "" If oName = DimName Then Call oDim.CenterText oCoords(0) = oDim.Text.Origin.X + DimX oCoords(1) = oDim.Text.Origin.Y + DimY Call oDim.Text.Origin.PutPointData(oCoords) Exit Sub End If Next oDim Next oView Next oSheet End Sub
Solved! Go to Solution.