Visibility of center mark on AcadDimArcLength

Visibility of center mark on AcadDimArcLength

larry.daubenspeck
Advocate Advocate
443 Views
1 Reply
Message 1 of 2

Visibility of center mark on AcadDimArcLength

larry.daubenspeck
Advocate
Advocate

I am showing a plan view of a a large curved object.  To show the length along the arc, I have used the AcadDimArcLenth.  When ZoomExtents is used, it wants to include the center mark, and all I want is the object.  How do I turn off the center mark? 

Larry Daubenspeck
Software Programmer
Draper, Inc.
0 Likes
Accepted solutions (1)
444 Views
1 Reply
Reply (1)
Message 2 of 2

norman.yuan
Mentor
Mentor
Accepted solution

Instead of calling Application.ZoomExtents(), you call Application.ZoomWindow() with the proper window's main/max points. Assume, you only want to zoom to the extents of the ARC itself, then you can call AcadEntity.GetBoundingBox to get the window's min/max points, like this:

 

Public Sub ZoomToArc()

    Dim ent As AcadEntity
    Dim pt As Variant
    
    ThisDrawing.Utility.GetEntity ent, pt, vbCr & "Pick the arc:"
    If ent Is Nothing Then Exit Sub
    
    Dim minPt As Variant
    Dim maxPt As Variant
    
    ent.GetBoundingBox minPt, maxPt
    
    Application.ZoomWindow minPt, maxPt

End Sub

However, with the above code, if you use the AcadDimArcLength object to get the BoundingBox, then the Dim's center point is included with the extents. So, if you need to zoom to the ARC and the ArcLength dimension (without its center), you need to find a way to calculate the window min/max points. it would be tricky. One easier, but not pretty, way could be:

 

Create a copy of the ArcLength dimension, then explode it;

Get the BoundingBoxex of the exploded entities and the Arc's;

Find the max bounding box of all the bounding boxes;

Delete the exploded entities;

Norman Yuan

Drive CAD With Code

EESignature

0 Likes