ObliqueAngle Property (ActiveX)

Specifies the oblique angle of the object.

Supported platforms: Windows only

Signature

VBA:

object.ObliqueAngle
object

Type: Attribute, AttributeReference, Shape, Text, TextStyle

The objects this property applies to.

Property Value

Read-only: No

Type: Double

The angle in radians within the range of -85 to +85 degrees. A positive angle denotes a lean to the right; a negative value will have 2*PI added to it to convert it to its positive equivalent.

Remarks

The oblique angle is the object's "angle of slant" away from its vertical axis.



Examples

VBA:

Sub Example_ObliqueAngle()
    ' This example creates a text object in model space.
    ' It then changes the ObliqueAngle of the text object.

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double
    
    ' Define the text object
    textString = "Hello, World."
    insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0
    height = 0.5
    
    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
    ZoomAll
    MsgBox "The ObliqueAngle is " & textObj.ObliqueAngle, vbInformation, "ObliqueAngle Example"
    
    ' Change the value of the ObliqueAngle to 45 degrees (.707 radians)
    textObj.ObliqueAngle = 0.707
    ZoomAll
    MsgBox "The ObliqueAngle is set to " & textObj.ObliqueAngle, vbInformation, "ObliqueAngle Example"
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ObliqueAngle()
    ;; This example creates a text object in model space.
    ;; It then changes the ObliqueAngle of the text object.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define the text object
    (setq insertionPoint (vlax-3d-point 3 3 0)
          textString "Hello, World."
          height 0.5)
    
    ;; Create the text object in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq textObj (vla-AddText modelSpace textString insertionPoint height))  
    (vla-ZoomAll acadObj)
  
    (alert (strcat "The ObliqueAngle is " (rtos (vla-get-ObliqueAngle textObj) 2)))
    
    ;; Change the value of the ObliqueAngle to 45 degrees (.707 radians)
    (vla-put-ObliqueAngle textObj 0.707)
    (vla-ZoomAll acadObj)
    (alert (strcat "The ObliqueAngle is set to " (rtos (vla-get-ObliqueAngle textObj) 2)))
)