Creates a diametric dimension for a circle or arc given the two points on the diameter and the length of the leader line.
Supported platforms: Windows only
VBA:
RetVal = object.AddDimDiametric(ChordPoint, FarChordPoint, LeaderLength)
Type: Block, ModelSpace, PaperSpace
The objects this method applies to.
Access: Input-only
Type: Variant (three-element array of doubles)
The 3D WCS coordinates specifying the first diameter point on the circle or arc.
Access: Input-only
Type: Variant (three-element array of doubles)
The 3D WCS coordinates specifying the second diameter point on the circle or arc.
Access: Input-only
Type: Double
The positive value representing the length from the ChordPoint to the annotation text or dogleg.
Different types of diameter dimensions are created depending on the size of the circle or arc, the length of the leader line, and the values of the AutoCAD DIMUPT, DIMTOFL, DIMFIT, DIMTIH, DIMTOH, DIMJUST, and DIMTAD system variables.
For horizontal dimension text, if the angle of the dimension line is more than 15 degrees from horizontal, and is outside the circle or arc, AutoCAD draws a hook line, also called a landing or dogleg. The hook line is one arrowhead long, and is placed next to the dimension text, as shown in the first two illustrations.
This function uses the LeaderLength parameter as the distance from the ChordPoint to the point where the dimension will do a horizontal dogleg to the annotation text (or stop if no dogleg is necessary).
The LeaderLength setting will only be used during the creation of the dimension (and even then only if the dimension is set to use the default text position value). After the dimension has been closed for the first time, changing the LeaderLength value will not affect how the dimension displays, but the new setting will be stored and will show up in DXF, LISP, and ARX.
VBA:
Sub Example_AddDimDiametric() ' This example creates a diametric dimension in model space. Dim dimObj As AcadDimDiametric Dim chordPoint(0 To 2) As Double Dim farChordPoint(0 To 2) As Double Dim leaderLength As Double ' Define the dimension chordPoint(0) = 5#: chordPoint(1) = 3#: chordPoint(2) = 0# farChordPoint(0) = 5#: farChordPoint(1) = 5#: farChordPoint(2) = 0# leaderLength = 1# ' Create the diametric dimension in model space Set dimObj = ThisDrawing.ModelSpace.AddDimDiametric(chordPoint, farChordPoint, leaderLength) ZoomAll End Sub
Visual LISP:
(vl-load-com) (defun c:Example_AddDimDiametric() ;; This example creates a diametric dimension in model space. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Define the dimension (setq chordPoint (vlax-3d-point 5 3 0) farChordPoint (vlax-3d-point 5 5 0) leaderLength 1) ;; Create the diametric dimension in model space (setq modelSpace (vla-get-ModelSpace doc)) (setq dimObj (vla-AddDimDiametric modelSpace chordPoint farChordPoint leaderLength)) (vla-ZoomAll acadObj) )