Radius Dimension Text Position in Drawing

Radius Dimension Text Position in Drawing

johnster100
Collaborator Collaborator
936 Views
5 Replies
Message 1 of 6

Radius Dimension Text Position in Drawing

johnster100
Collaborator
Collaborator

Hi,

I have some drawings which i set the dimension locations automatically using API. All the dimensions on the drawing already exist. I am simply setting their location using the text.origin property.

 

It works fine for most things apart from Radius dimensions. The issue with radius dimensions is that the dimension leader often ends off the curve (it's only a partial curve):

 

Capture.JPG

 

Is there a way to force or check that the arrow head is on the curve?

 

I should also mention that I'm using retrieved dimensions.

 

thanks,

John

0 Likes
Accepted solutions (1)
937 Views
5 Replies
Replies (5)
Message 2 of 6

Ralf_Krieg
Advisor
Advisor

Hello

 

I think this dimension is on a contruction line. Check your dimension if it's entity is construction.

If MyDimension.RetrievedFrom= True Then
    If MyDimension.RetrievedFrom.Entity.Construction = False Then
        MyDimension.Text.Origin = oNewPoint
....

 


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 6

johnster100
Collaborator
Collaborator

Hi,

thanks for the reply.

 

It's retrieved from a fillet feature, so I have no geometry to check against 😞

 

thanks,

John

0 Likes
Message 4 of 6

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

Ok, I see only one way at this time. We can use the Curve2DEvaluator of the drawing curves of the fillet feature to check if the end point of the dimension line is on the drawing curve. This is anything but smart, but maybe you can use it.

The macro assumes currently there's only 1 drawing view on the active sheet. To test it, select the dimension you want to check and run the macro.

Hopefully someone find's a better way.

Private Sub OnCurve()

Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument

Dim oDim As RadiusGeneralDimension
Set oDim = oDrawDoc.SelectSet(1)

Dim oPoint As Point2d
Set oPoint = oDim.DimensionLine.EndPoint

Dim oDrawView As DrawingView
Set oDrawView = oDrawDoc.ActiveSheet.DrawingViews.Item(1)

Dim oDrawCurves As DrawingCurvesEnumerator
Set oDrawCurves = oDrawView.DrawingCurves(oDim.RetrievedFrom.Parent)

Dim bNotOnCurve As Boolean
bNotOnCurve = True

Dim Points(1) As Double
Points(0) = oPoint.x
Points(1) = oPoint.y

Dim oDrawCurve As DrawingCurve
For Each oDrawCurve In oDrawCurves

    Dim oCurveEval As Curve2dEvaluator
    Set oCurveEval = oDrawCurve.Evaluator2D
    
    Dim GuessParams() As Double
    Dim MaxDeviations() As Double
    Dim Params() As Double
    Dim SolTypes() As SolutionNatureEnum
        
    On Error Resume Next
    Call oCurveEval.GetParamAtPoint(Points, GuessParams, MaxDeviations, Params, SolTypes)
        
    If ERR.Number = 0 Then
        bNotOnCurve = False
        ERR.Clear
        Exit For
    End If
    
Next

If bNotOnCurve = True Then
    MsgBox ("Not on Curve")
Else
    MsgBox ("On Curve")
End If

End Sub

 


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 5 of 6

johnster100
Collaborator
Collaborator

thanks for your help,

I shall give it a try tomorrow!

 

thanks,

John

 

0 Likes
Message 6 of 6

johnster100
Collaborator
Collaborator

thanks again for the help, I think I could get this to work but it's a bit too much hassle.

 

I think I will use leaders and read the in the model value. Again it's not an elegant solution but will have to suffice for just now.

 

It would be good if there was an option for arrowhead to be on curved.

 

thanks,

John

0 Likes