Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I created an iLogic Rule to arrange the dimensions in a drawing document automatically.
Private Sub ReArrangeDrawingDimensions(oSheet As Inventor.Sheet, drawingView As Inventor.DrawingView, dimensionName As String, Optional xCoord As Double = 0, Optional yCoord As Double = 0)
Dim oGeneralDimensions As GeneralDimensions
oGeneralDimensions = oSheet.DrawingDimensions.GeneralDimensions
Dim xCoordComp, yCoordComp As Double
Dim oWidthDim, oHeightDim, oDepthDim As LinearGeneralDimension
Dim oCompDim As LinearGeneralDimension
Dim newPosComp As Point2d
For Each oGeneralDimension As GeneralDimension In oGeneralDimensions
If oGeneralDimension.AttributeSets.Count >0 Then
If oGeneralDimension.AttributeSets.Item(1).Name = dimensionName Then
oCompDim = oGeneralDimension
End If
End If
Next
If xCoord = 0 Then
xCoordComp = oCompDim.Text.Origin.X
Else
xCoordComp = xCoord
End If
If yCoord = 0 Then
yCoordComp = oCompDim.Text.Origin.Y
Else
yCoordComp = yCoord
End If
newPosComp = ThisApplication.TransientGeometry.CreatePoint2d(xCoordComp, yCoordComp)
oCompDim.Text.Origin = newPosComp
End Sub
For most of the dimensions this rule works just fine but one dimension is giving me trouble.
The Dimension Text is rotated by 90 ° and I can't figure out why.
The only thing different from the other dimensions is that the DimensionLine.Direction.Y Property of the dimension is -1 instead of 1, but this property is read-only.
Solved! Go to Solution.