Share
 
 

Type Property (ActiveX)

Specifies type of a Leader, MenuGroup, PopupMenuItem, ToolbarItem, Polyline, or PolygonMesh object.

Supported platforms: Windows only

Signature

VBA:

object.Type
object

Type: 3DPolyline, Leader, MenuGroup, PolygonMesh, Polyline, PopupMenuItem, ToolbarItem

The object this property applies to.

Property Value - 3DPolyline

Read-only: No

Type: ac3DPolylineType enum

  • acSimple3DPoly: A simple polyline.
  • acQuadSpline3DPoly: A quadratic B-spline polyline.
  • acCubicSpline3DPoly: A cubic B-spline polyline.

Property Value - Leader

Read-only: No

Type: acLeaderType enum

  • acLineNoArrow: A line with no arrow.
  • acLineWithArrow: A line with arrow.
  • acSplineNoArrow: A spline with no arrow.
  • acSplineWithArrow: A spline with arrow.

Property Value - MenuGroup

Read-only: Yes

Type: acMenuGroupType enum

  • acBaseMenuGroup: The base menu group.
  • acPartialMenuGroup: A partial menu group.

Property Value - PolygonMesh

Read-only: No

Type: acPolymeshType enum

  • acSimpleMesh: A simple mesh with no surface fitting or smoothing.
  • acQuadSurfaceMesh: A quadratic B-spline surface fit.
  • acCubicSurfaceMesh: A cubic B-spline surface fit.
  • acBezierSurfaceMesh: A Bezier surface fit.

Property Value - Polyline

Read-only: No

Type: acPolylineType enum

  • acSimplePoly: A simple polyline.
  • acFitCurvePoly: A fit curve polyline.
  • acQuadSplinePoly: A quadratic B-spline polyline.
  • acCubicSplinePoly: A cubic B-spline polyline.

Property Value - PopupMenuItem

Read-only: Yes

Type: acMenuItemType enum

  • acMenuItem: A menu item.
  • acMenuSeparator: A menu separator.
  • acMenuSubMenu: A sub menu.

Property Value - ToolbarItem

Read-only: Yes

Type: acToolbarItemType enum

  • acToolbarButton: A generic button.
  • acToolbarFlyout: A flyout button.
  • acToolbarControl: A control button.
  • acToolbarSeparator: A separator.

Remarks

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.

Examples

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.")
                                         )))
)

Was this information helpful?