Vla-get-textposition

提供:GizmoLabs - だいたい CAD LISP なサイト
構文
(vla-get-textposition vla-object )


機能
寸法値の位置を指定する。


引数
  • vla-object … VLAオブジェクト(Dim3PointAngular、DimAligned、DimAngular、DimArcLength、DimDiametric、Dimension、DimOrdinate、DimRadial、DimRadialLarge、DimRotated)


戻り値
寸法値の位置を表す 3D WCS 座標


サンプル
(vl-load-com)
(defun c:Example_TextPosition()
    ;; 寸法を作成して文字位置を指定するサンプル
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; 寸法の定義
    (setq point1 (vlax-3d-point 5 3 0)
          point2 (vlax-3d-point 10 3 0)
          location (vlax-3d-point 7.5 5 0))
    
    ;; 寸法を作成
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq dimObj (vla-AddDimAligned modelSpace point1 point2 location))

    (vla-ZoomAll acadObj)
    (setq textPosition (vlax-variant-value (vla-get-TextPosition dimObj)))
    (alert (strcat "現在の寸法値位置は " 
                   (rtos (vlax-safearray-get-element textPosition 0) 2) ", "
                   (rtos (vlax-safearray-get-element textPosition 1) 2) ", "
                   (rtos (vlax-safearray-get-element textPosition 2) 2)))
    
    ;; 変更
    (setq location (vlax-3d-point 8.5 7 0))
    (vla-put-TextPosition dimObj location)
    (vla-Update dimObj)
    
    ;; 取得
    (setq retPoint (vlax-variant-value (vla-get-TextPosition dimObj)))

    (alert (strcat "新しい寸法値位置は " 
                   (rtos (vlax-safearray-get-element retPoint 0) 2) ", "
                   (rtos (vlax-safearray-get-element retPoint 1) 2) ", "
                   (rtos (vlax-safearray-get-element retPoint 2) 2)))
)

関連事項