CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

类型属性 (ActiveX)

2023-1-3 02:32| 发布者: admin| 查看: 169| 评论: 0|来自: AutoCAD

摘要: 指定引线、菜单组、弹出菜单项、工具栏项、折线或多边形网格对象的类型。

指定引线、菜单组、弹出菜单项、工具栏项、折线或多边形网格对象的类型。

支持的平台:仅窗口

签名

工 务 局:

object.Type
对象

类型:3D线,线,菜单多边形网格折线弹出菜单项,工具栏项

此属性适用的对象。

属性值 - 3D奥利线

只读:

类型:枚举ac3DPolylineType

  • acSimple3DPoly:简单的折线。
  • acQuadSpline3DPoly:二次 B 样条多段线。
  • acCubicSpline3DPoly:三次 B 样条折线。

物业价值 - 领导者

只读:

类型:枚举acLeaderType

  • acLineNoArrow:没有箭头的线条。
  • acLineWithArrow:带箭头的线条。
  • acSplineNoArrow:不带箭头的样条曲线。
  • acSplineWithArrow:带箭头的样条曲线。

属性值 - 菜单组

只读:是的

类型:枚举acMenuGroupType

  • acBaseMenuGroup:基本菜单组。
  • acPartialMenuGroup:部分菜单组。

属性值 - 多边形网格

只读:

类型:枚举acPolymeshType

  • acSimpleMesh:没有表面拟合或平滑的简单网格。
  • acQuadSurfaceMesh:二次 B 样条曲面拟合。
  • acCubicSurfaceMesh:三次 B 样条曲面拟合。
  • acBezierSurfaceMesh:贝塞尔表面贴合度。

属性值 - 折线

只读:

类型:枚举acPolylineType

  • acSimplePoly:简单的折线。
  • acFitCurvePoly:拟合曲线折线。
  • acQuadSplinePoly:二次 B 样条多段线。
  • acCubicSplinePoly:三次 B 样条折线。

属性值 - 弹出菜单项

只读:是的

类型:枚举acMenuItemType

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

Property Value - ToolbarItem

Read-only: Yes

Type: enum acToolbarItemType

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

Remarks

PolygonMesh: If the type is set to then the M and N vertex count values will be used for vertex row column sizes. For any other type, the M and N density values will be used as the row and column sizes. PolygonMeshacSimpleMeshPolygonMesh

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

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-12 04:28

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部