ElevationModelSpace 属性 (ActiveX) 
指定模型空间中的高程设置。 支持的平台:仅限 Windows 属性值只读:不 类型:双 模型空间的高程设置。 言论当前高程是每当需要 3D 点但仅提供 X 和 Y 值时使用的 Z 值。当前高程分别在模型空间和图纸空间中维护。 例子VBA: 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
可视化 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)))
)
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 23:09
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.