Vla-put-customscale
- 構文
- (vla-put-customscale vla-object scale )
- 機能
- ビューポートのカスタム尺度を指定する。
- 引数
-
- vla-object … PViewport のVLAオブジェクト
- scale … ビューポートのカスタム尺度
- 戻り値
- nil
- MEMO: ビューポートをカスタム尺度に設定するには、まず StandardScale プロパティを acVpCustomScale に設定してから、このプロパティを使用してカスタム尺度を定義する。
- サンプル
(vl-load-com)
(defun c:Example_CustomScale()
;; ペーパー空間に線を追加します、新しいペーパー空間ビューポートを作成し、
;; 順番に新しいペーパー空間ビューポートのいくつかの共通の用紙スペース カスタム スケールのサイズ
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; 始点と終点
(setq startPoint (vlax-3d-point 1 1 0)
endPoint (vlax-3d-point 5 5 0))
;; ビューポートの定義
(setq center (vlax-3d-point 3 3 0)
width 40
height 40)
;; 線分を作成
(setq paperSpace (vla-get-PaperSpace doc))
(setq lineObj (vla-AddLine paperSpace startPoint endPoint))
;; ビューポートを作成
(setq PViewPort (vla-AddPViewport paperSpace center width height))
;; カスタム尺度を設定
(vla-put-StandardScale PViewPort acVpCustomScale)
;; ペーパー空間に変更
(vla-put-ActiveSpace doc acPaperSpace)
(vla-Regen doc acAllViewports)
(vla-ZoomAll acadObj)
;; 変更
(alert (strcat "現在の PViewport の尺度は : " (rtos (vla-get-CustomScale PViewPort) 2)))
;; 尺度を変更 1:10
(vla-put-CustomScale PViewPort 0.1)
;; 読み込み
(alert (strcat "新しい PViewport の尺度は : " (rtos (vla-get-CustomScale PViewPort) 2)))
)
関連事項