CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

打印旋转属性 (ActiveX)

2023-1-3 08:35| 发布者: admin| 查看: 453| 评论: 0|来自: AutoCAD

摘要: 指定布局或打印配置的旋转角度。

指定布局或打印配置的旋转角度。

支持的平台:仅窗口

签名

工 务 局:

object.PlotRotation
对象

类型:布局绘图配置

此属性适用的对象。

属性值

只读:

类型:枚举acPlotRotation

  • ac0degrees
  • ac90degrees
  • ac180degrees
  • ac270degrees

言论

旋转角度相对于对象 WCS 的X轴,从Z轴向下看向原点时,正角逆时针方向移动。

在重新生成图形之前,对此属性的更改将不可见。使用该方法再生图形。Regen

例子

工 务 局:

Sub Example_PlotRotation()
    ' This example reads and modifies the PlotRotation
    ' Layout value.
    ' When finished, this example resets the  value back to
    ' its original value.
    
    Dim ACADLayout As ACADLayout
    Dim originalValue As Integer
    
    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout
    
    ' Read and display the original value
    originalValue = ACADLayout.PlotRotation
    MsgBox "The PlotRotation value is set to: " & originalValue

    ' Modify the PlotRotation preference by toggling the value
    ACADLayout.PlotRotation = ac180degrees
    MsgBox "The PlotRotation preference has been set to: " & ACADLayout.PlotRotation

    ' Reset the preference back to its original value
    ACADLayout.PlotRotation = originalValue
    MsgBox "The PlotRotation preference was reset back to: " & originalValue
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_PlotRotation()
    ;; This example reads and modifies the PlotRotation
    ;; Layout value.
    ;; When finished, this example resets the  value back to
    ;; its original value.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Get the layout object
    (setq ACADLayout (vla-get-ActiveLayout doc))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-PlotRotation ACADLayout))
    (alert (strcat "The PlotRotation value is set to: " (itoa originalValue)))

    ;; Modify the PlotRotation preference by toggling the value
    (vla-put-PlotRotation ACADLayout ac180degrees)
    (alert (strcat "The PlotRotation preference has been set to: " (itoa (vla-get-PlotRotation ACADLayout))))

    ;; Reset the preference back to its original value
    (vla-put-PlotRotation ACADLayout originalValue)
    (alert (strcat "The PlotRotation preference was reset back to: " (itoa originalValue)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-11 14:31

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部