Moving dimension problem

Moving dimension problem

Anonymous
Not applicable
552 Views
1 Reply
Message 1 of 2

Moving dimension problem

Anonymous
Not applicable

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

0 Likes
Accepted solutions (1)
553 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

I somehow missed the elevatio property....

 

Now I have the following

 

myDim.Elevation = 0.0
myDim.XLine1Point = New Point3d(myDim.XLine1Point.X, myDim.XLine1Point.Y, 0.0)
myDim.XLine2Point = New Point3d(myDim.XLine2Point.X, myDim.XLine2Point.Y, 0.0)

 

seems to have resolved the issue.

 

Not sure how to remove this post, but it might be helpfull to somebody.

 

cj

0 Likes