CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

线型比例特性 (ActiveX)

2023-1-3 11:53| 发布者: admin| 查看: 451| 评论: 0|来自: AutoCAD

摘要: 指定对象的线型比例。

指定对象的线型比例。

支持的平台:仅窗口

签名

工 务 局:

object.LinetypeScale
对象

类型:所有图形对象属性引用子DMeshEdge,SubDMeshFace,SubDMeshVertexSubEntitySubEntSolidEdge,SubEntSolidFace,SubEntSolidNode,SubEntSolidVertex

此属性适用的对象。

属性值

只读:不;除了只写的对象Group

类型:

此值必须是正实数。默认值为 1.0。

言论

对象的线型比例指定每个图形单位的虚线点线型的相对长度。

  • :线型比例 = 1.0
  • :线型比例 = 0.5
  • :线型比例 = 0.25

例子

工 务 局:

Sub Example_LinetypeScale()
    ' This example creates a line and finds the linetype scale
    ' for the line. It then changes the linetype scale, and finally
    ' resets the linetype scale back to the original value.
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    Dim lineObj As AcadLine
    Dim currLTScale As Double

    ' Create a Line object in model space
    startPoint(0) = 2#: startPoint(1) = 2#: startPoint(2) = 0#
    endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    lineObj.Update
    currLTScale = lineObj.LinetypeScale
    MsgBox "The linetype scale for the line is: " & lineObj.LinetypeScale, vbInformation, "Linetypes Example"

    ' Set the linetype scale of a Line to .5
    lineObj.LinetypeScale = 0.5
    lineObj.Update
    MsgBox "The new linetype scale for the line is: " & lineObj.LinetypeScale, vbInformation, "Linetypes Example"
    
    ' Reset the linetype scale of a Line to what is was before
    lineObj.LinetypeScale = currLTScale
    lineObj.Update
    MsgBox "The linetype scale for the line is reset to: " & lineObj.LinetypeScale, vbInformation, "Linetypes Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_LinetypeScale()
    ;; This example creates a line and finds the linetype scale
    ;; for the line. It then changes the linetype scale, and finally
    ;; resets the linetype scale back to the original value.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; Create a Line object in model space
    (setq startPoint (vlax-3d-point 2 2 0)
          endPoint (vlax-3d-point 4 4 0))
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq lineObj (vla-AddLine modelSpace startPoint endPoint))
    (vla-Update lineObj)
  
    (setq currLTScale (vla-get-LinetypeScale lineObj))
    (alert (strcat "The linetype scale for the line is: " (rtos currLTScale 2)))

    ;; Set the linetype scale of a Line to .5
    (vla-put-LinetypeScale lineObj 0.5)
    (vla-Update lineObj)
    (alert (strcat "The new linetype scale for the line is: " (rtos (vla-get-LinetypeScale lineObj) 2)))
    
    ;; Reset the linetype scale of a Line to what is was before
    (vla-put-LinetypeScale lineObj currLTScale)
    (vla-Update lineObj)
    (alert (strcat "The linetype scale for the line is reset to: " (rtos (vla-get-LinetypeScale lineObj) 2)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-19 14:35

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部