ElevationModelSpace Property (ActiveX)

Specifies the elevation setting in model space.

Supported platforms: Windows only

Signature

VBA:

object.ElevationModelSpace
object

Type: Database, Document

The objects this property applies to.

Property Value

Read-only: No

Type: Double

The elevation setting for model space.

Remarks

The current elevation is the Z value that is used whenever a 3D point is expected but only the X and Y values are supplied. The current elevation is maintained separately in model space and paper space.

Examples

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

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