| 创建旋转的线性尺寸。 支持的平台:仅窗口 签名工 务 局: RetVal = object.AddDimRotated(XLine1Point, XLine2Point, DimLineLocation, RotationAngle) 言论 以 45 度创建的线性尺寸 例子工 务 局: Sub Example_AddDimRotated()
    ' This example creates a rotated dimension in model space.
        
    Dim dimObj As AcadDimRotated
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim location(0 To 2) As Double
    Dim rotAngle As Double
    
    ' Define the dimension
    point1(0) = 0#: point1(1) = 5#: point1(2) = 0#
    point2(0) = 5#: point2(1) = 5#: point2(2) = 0#
    location(0) = 0#: location(1) = 0#: location(2) = 0#
    rotAngle = 120
    rotAngle = rotAngle * 3.141592 / 180#       ' covert to Radians
    
    ' Create the rotated dimension in model space
    Set dimObj = ThisDrawing.ModelSpace.AddDimRotated(point1, point2, location, rotAngle)
    ZoomAll
End SubVisual LISP: (vl-load-com)
(defun c:Example_AddDimRotated()
    ;; This example creates a rotated dimension in model space.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
        
    ;; Define the dimension
    (setq point1 (vlax-3d-point 0 5 0)
          point2 (vlax-3d-point 5 5 0)
          location (vlax-3d-point 0 0 0)
          rotAngle (/ (* 120 3.141592) 180))
    
    ;; Create the rotated dimension in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq dimObj (vla-AddDimRotated modelSpace point1 point2 location rotAngle))
    (vla-ZoomAll acadObj)
) | 
 |Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-1 01:42
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.