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