Vla-put-tolerancejustification
- 構文
- (vla-put-tolerancejustification vla-object justify)
- 機能
- 寸法値に対する、寸法許容差値の垂直方向の位置合わせを指定する。
- 引数
- 
- vla-object … VLAオブジェクト(Dim3PointAngular、DimAligned、DimAngular、DimArcLength、DimDiametric、Dimension、DimOrdinate、DimRadial、DimRadialLarge、DimRotated)
- justify … acDimToleranceJustify 列挙型
 - acTolTop : 上
- acTolMiddle : 中央
- acTolBottom : 下
 
 
- 戻り値
- nil
- MEMO : このプロパティの初期値は acTolMiddle。このプロパティは ToleranceDisplay プロパティが acTolNone 以外の値に設定されている場合にのみ使用できる。
- このプロパティは、指定された寸法でシステム変数 DIMTOLJ[許容差垂直位置]の値を変更する。
- サンプル
(vl-load-com)
(defun c:Example_ToleranceJustification()
    ;; 寸法を作成して、公差の位置合わせを変更するサンプル
    ;; * 公差文字の垂直位置に注意。
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; 寸法の定義
    (setq point1 (vlax-3d-point 5 5 0)
          point2 (vlax-3d-point 5.5 5 0)
          location (vlax-3d-point 5 7 0))
    ;; 長さ寸法を作成
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq dimObj (vla-AddDimAligned modelSpace point1 point2 location))
    
    ;; 許容差を表示して、寸法文字の高さを上げるため、公差の位置合わせを表示
    (vla-put-ToleranceDisplay dimObj acTolSymmetrical)
    (vla-put-TextHeight dimObj 1)
    (vla-put-ToleranceHeightScale dimObj 0.25)
    
    (vla-ZoomAll acadObj)
    (vla-Regen doc acAllViewports)
    
    ;; 現在の許容差を読み込んで表示
    (setq currentDisplay (cond
                             ((= (vla-get-ToleranceJustification dimObj) acTolBottom) "下")
                             ((= (vla-get-ToleranceJustification dimObj) acTolTop) "上")
                             ((= (vla-get-ToleranceJustification dimObj) acTolMiddle) "中央")
                         ))
    
    (alert (strcat "現在の公差の位置合わせ : " currentDisplay))
    
    ;; 公差の位置合わせを下に変更
    (vla-put-ToleranceJustification dimObj acTolBottom)
    
    (vla-Regen doc acAllViewports)
    
    ;; 現在の公差の位置合わせ 
    (alert "公差の位置合わせ : 下")
)
関連事項
