Hello everyone ;
So far , I have managed to add diametric dimension and I know how to update the dimension text.But now I have point setting problems on the added dimension.Here is what I have wrote :
- Private Sub AddDimensionText() Dim dimDiametric As AcadDimDiametric Dim util As AcadUtility Dim entity As AcadEntity Dim circ As AcadCircle Dim centerPoint As Variant Dim pt1(0 To 2) As Double Dim pt2(0 To 2) As Double Dim dimLength As Double Dim mainLength As Double On Error Resume Next Set util = ThisDrawing.Utility util.GetEntity entity, centerPoint, "Select circle" If Err.Number 0 Then Err.Clear MsgBox "Entity not selected" Else If TypeOf entity Is AcadCircle Then Set circ = entity centerPoint = circ.Center dimLength = circ.Radius mainLength = Math.Sqr((dimLength * dimLength) + (dimLength * dimLength)) pt1(0) = centerPoint(0) + dimLength: pt1(1) = centerPoint (1) + dimLength: pt1(2) = 0 pt2(0) = pt1(0) + mainLength: pt2(1) = pt1(1) + mainLength: pt2(2) = 0 Set dimDiametric = ThisDrawing.ModelSpace.AddDimDiametric(pt2, pt1, 0) dimDiametric.Update Else MsgBox "Please select a circle" End If End If End Sub
I could not fix the position of the dimension as we can do with ampowerdim_dia command.Is there a way to edit programmatically the dimension text after finishing the dimensioning using ampowerdim_dia ? How can we understand that some user is finished using ampowerdim_dia command ? Thanks a lot , happy new year... |