
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In some cases we have drawings that have dimensions that have ended up with a Z value other than 0. I need to get them put back to a Z value of 0.
I have got the following code to move the Xline1Point and teh Xline2Point moved, but the DimlinePoint and Textposition do not move???
What am I mising??? any suggestion(s) are greatly appreciated.
If myPSR.Status = PromptStatus.OK Then
Dim DimSS As SelectionSet = myPSR.Value
Dim trans As Transaction = acaddoc.TransactionManager.StartTransaction
Try
For Each obj In DimSS
Dim Ent As Entity = obj.ObjectId.GetObject(OpenMode.ForWrite)
If TypeOf Ent Is RotatedDimension Then
Dim myDim As RotatedDimension = trans.GetObject(obj.ObjectId, OpenMode.ForWrite, False, True)
myDim.XLine1Point = New Point3d(myDim.XLine1Point.X, myDim.XLine1Point.Y, 0.0)
myDim.XLine2Point = New Point3d(myDim.XLine2Point.X, myDim.XLine2Point.Y, 0.0)
myDim.DimLinePoint = New Point3d(myDim.DimLinePoint.X, myDim.DimLinePoint.Y, 0.0)
myDim.TextPosition = New Point3d(myDim.TextPosition.X, myDim.TextPosition.Y, 0.0)
DimCnt = DimCnt + 1
End If
Next
' all ok, commit it
trans.Commit()
Catch ex As Autodesk.AutoCAD.Runtime.Exception
MsgBox("A problem occured with a dimension object " + ex.Message)
Finally
trans.Dispose()
End Try
End If
Solved! Go to Solution.