CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

高程模型空间属性 (ActiveX)

2023-1-3 17:43| 发布者: admin| 查看: 441| 评论: 0|来自: AutoCAD

摘要: 指定模型空间中的高程设置。

指定模型空间中的高程设置。

支持的平台:仅窗口

签名

工 务 局:

object.ElevationModelSpace
对象

类型:数据库文档

此属性适用的对象。

属性值

只读:

类型:

模型空间的高程设置。

言论

当前高程是Z值,每当需要 3D 点但仅提供XY值时都会使用该值。当前高程在模型空间和图纸空间中分别维护。

例子

工 务 局:

Sub Example_ElevationModelSpace()
    ' This example changes the model space elevation of the current drawing
    ' and then resets it to the original value again.
    
    Dim currElevation As Double
    
    currElevation = ThisDrawing.ElevationModelSpace
    MsgBox "The current model space elevation is " & ThisDrawing.ElevationModelSpace, vbInformation, "ElevationModelSpace Example"
    
    ' Change the elevation
    ThisDrawing.ElevationModelSpace = currElevation + 2
    MsgBox "The new model space elevation is " & ThisDrawing.ElevationModelSpace, vbInformation, "ElevationModelSpace Example"
    
    ' Reset the elevation to its original value
    ThisDrawing.ElevationModelSpace = currElevation
    MsgBox "The model space elevation is reset to " & ThisDrawing.ElevationModelSpace, vbInformation, "ElevationModelSpace Example"

End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ElevationModelSpace()
    ;; This example changes the model space elevation of the current drawing
    ;; and then resets it to the original value again.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    (setq currElevation (vla-get-ElevationModelSpace doc))
    (alert (strcat "The current model space elevation is " (rtos currElevation 2)))
    
    ;; Change the elevation
    (vla-put-ElevationModelSpace doc (+ currElevation 2))
    (alert (strcat "The new model space elevation is " (rtos (vla-get-ElevationModelSpace doc) 2)))
    
    ;; Reset the elevation to its original value
    (vla-put-ElevationModelSpace doc currElevation)
    (alert (strcat "The model space elevation is reset to " (rtos (vla-get-ElevationModelSpace doc) 2)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 02:35

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部