Specifies type of a Leader, MenuGroup, PopupMenuItem, ToolbarItem, Polyline, or PolygonMesh object.
Supported platforms: Windows only
VBA:
object.Type
Type: 3DPolyline, Leader, MenuGroup, PolygonMesh, Polyline, PopupMenuItem, ToolbarItem
The object this property applies to.
Read-only: No
Type: ac3DPolylineType enum
Read-only: No
Type: acLeaderType enum
Read-only: Yes
Type: acMenuGroupType enum
Read-only: No
Type: acPolymeshType enum
Read-only: No
Type: acPolylineType enum
Read-only: Yes
Type: acMenuItemType enum
Read-only: Yes
Type: acToolbarItemType enum
PolygonMesh: If the PolygonMesh type is set to acSimpleMesh then the M and N vertex count values will be used for vertex row column sizes. For any other PolygonMesh type, the M and N density values will be used as the row and column sizes.
VBA:
Sub Example_Type()
' This example creates a leader in model space.
' It then changes the type of the leader.
Dim leaderObj As AcadLeader
Dim points(0 To 8) As Double
Dim leaderType As Integer
Dim annotationObject As AcadEntity
points(0) = 0: points(1) = 2: points(2) = 0
points(3) = 4: points(4) = 4: points(5) = 0
points(6) = 4: points(7) = 2: points(8) = 0
leaderType = acLineNoArrow
Set annotationObject = Nothing
' Create the leader object in model space
Set leaderObj = ThisDrawing.ModelSpace.AddLeader(points, annotationObject, leaderType)
ZoomAll
' Find the current leader type
leaderType = leaderObj.Type
MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example"
' Change the leader type
leaderObj.Type = acLineWithArrow
leaderObj.Update
MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example"
' Change the leader type
leaderObj.Type = acSplineNoArrow
leaderObj.Update
MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example"
' Change the leader type
leaderObj.Type = acSplineWithArrow
leaderObj.Update
MsgBox "The leader type is " & Choose(leaderObj.Type + 1, "acLineNoArrow.", "acSplineNoArrow.", "acLineWithArrow.", "acSplineWithArrow."), , "Type Example"
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_Type()
;; This example creates a leader in model space.
;; It then changes the type of the leader.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq modelSpace (vla-get-ModelSpace doc))
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 8)))
(vlax-safearray-fill points '(0 2 0
4 4 0
4 2 0
)
)
(setq leaderType acLineNoArrow)
(setq point (vlax-3d-point 4 2 0))
(setq annotationObject (vla-AddMText modelSpace point 1 ""))
;; Create the leader object in model space
(setq leaderObj (vla-AddLeader modelSpace points annotationObject leaderType))
;; Remove the temporary annotaion object and adjust the last coordinate of the leader
(vla-Erase annotationObject)
(vla-put-Coordinate leaderObj 2 (vlax-3D-point 4 2 0))
(vla-ZoomAll acadObj)
;; Find the current leader type
(setq leaderType (vla-get-Type leaderObj))
(alert (strcat "The leader type is " (cond
((= leaderType acLineNoArrow) "acLineNoArrow.")
((= leaderType acSplineNoArrow) "acSplineNoArrow.")
((= leaderType acLineWithArrow) "acLineWithArrow.")
((= leaderType acSplineWithArrow) "acSplineWithArrow.")
)))
;; Change the leader type
(vla-put-Type leaderObj acLineWithArrow)
(vla-Update leaderObj)
(setq leaderType (vla-get-Type leaderObj))
(alert (strcat "The leader type is " (cond
((= leaderType acLineNoArrow) "acLineNoArrow.")
((= leaderType acSplineNoArrow) "acSplineNoArrow.")
((= leaderType acLineWithArrow) "acLineWithArrow.")
((= leaderType acSplineWithArrow) "acSplineWithArrow.")
)))
;; Change the leader type
(vla-put-Type leaderObj acSplineNoArrow)
(vla-Update leaderObj)
(setq leaderType (vla-get-Type leaderObj))
(alert (strcat "The leader type is " (cond
((= leaderType acLineNoArrow) "acLineNoArrow.")
((= leaderType acSplineNoArrow) "acSplineNoArrow.")
((= leaderType acLineWithArrow) "acLineWithArrow.")
((= leaderType acSplineWithArrow) "acSplineWithArrow.")
)))
;; Change the leader type
(vla-put-Type leaderObj acSplineWithArrow)
(vla-Update leaderObj)
(setq leaderType (vla-get-Type leaderObj))
(alert (strcat "The leader type is " (cond
((= leaderType acLineNoArrow) "acLineNoArrow.")
((= leaderType acSplineNoArrow) "acSplineNoArrow.")
((= leaderType acLineWithArrow) "acLineWithArrow.")
((= leaderType acSplineWithArrow) "acSplineWithArrow.")
)))
)