Vla-put-tolerancesuppressleadingzeros
- 構文
- (vla-put-tolerancesuppressleadingzeros vla-object Bool)
- 機能
- 寸法許容差値の先頭のゼロの省略を指定する。
- 引数
-
- vla-object … VLAオブジェクト(Dim3PointAngular、DimAligned、DimAngular、DimArcLength、DimDiametric、Dimension、DimOrdinate、DimRadial、DimRadialLarge、DimRotated)
- Bool … ブール型
- :Vlax-True: 十進表記の値の接頭のゼロを省略する。たとえば、0.5000 は .5000 になる。
- :Vlax-False: 十進表記の値の接頭のゼロを省略しない。
- 戻り値
- nil
- MEMO: このプロパティの初期値は False で、この値は、システム変数 DIMTZIN[寸法許容差 0 省略]の値を変更する。
- サンプル
(vl-load-com)
(defun c:Example_ToleranceSuppressLeadingZeros()
;; 長さ寸法を作成し、寸法公差の先頭のゼロ表示を切り替えるサンプル
(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.01 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-ToleranceLowerLimit dimObj -0.0001)
(vla-put-ToleranceUpperLimit dimObj 0.005)
(vla-ZoomAll acadObj)
;; 先頭のゼロ表示をトグル
(vla-put-ToleranceSuppressLeadingZeros dimObj (if (= (vla-get-ToleranceSuppressLeadingZeros dimObj) :vlax-true) :vlax-false :vlax-true))
(vla-Regen doc acAllViewports)
(alert "先頭のゼロ表示をトグル。")
;; Toggle the display of leading zeros for the dimension tolerance value back to previous state
(vla-put-ToleranceSuppressLeadingZeros dimObj (if (= (vla-get-ToleranceSuppressLeadingZeros dimObj) :vlax-true) :vlax-false :vlax-true))
(vla-Regen doc acAllViewports)
(alert "先頭のゼロ表示を戻しました。")
)
関連事項