Vla-put-zscalefactor

提供:GizmoLabs - だいたい CAD LISP なサイト
構文
(vla-put-zscalefactor vla-object 'scale)


機能
ブロックまたは外部参照(xref)の Z 倍率を指定する。


引数
  • vla-object … VLAオブジェクト(BlockReference、ExternalReference、MInsertBlock)
  • scale … ゼロでない実数


戻り値
nil


  • MEMO :倍率の初期値は 1.0。


サンプル
(vl-load-com)
(defun c:Example_XYZScaleFactor()
    ;; ブロックを作成して倍膣を変えるサンプル
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; ブロック作成
    (setq insertionPnt (vlax-3d-point 0 0 0))
    (setq blockObj (vla-Add (vla-get-Blocks doc) insertionPnt "CircleBlock"))
    
    ;; ブロックに円を作成
    (setq center (vlax-3d-point 0 0 0)
          radius 1)
    (setq circleObj (vla-AddCircle blockObj center radius))
   
    ;; ブロック挿入
    (setq insertionPnt (vlax-3d-point 2 2 0))
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq blockRefObj (vla-InsertBlock modelSpace insertionPnt "CircleBlock" 1 1 1 0))
    
    ;; 倍率を取得
    (setq currXScaleFactor (vla-get-XScaleFactor blockRefObj))
    (setq currYScaleFactor (vla-get-YScaleFactor blockRefObj))
    (setq currZScaleFactor (vla-get-ZScaleFactor blockRefObj))
    (vla-ZoomAll acadObj)
    (alert (strcat "現在のブロックの倍率は " 
                   (rtos (vla-get-XScaleFactor blockRefObj) 2) ","
                   (rtos (vla-get-YScaleFactor blockRefObj) 2) ","
                   (rtos (vla-get-ZScaleFactor blockRefObj) 2) ""
                   ))
    
    ;; 倍率変更
    (vla-put-XScaleFactor blockRefObj (+ currXScaleFactor 2))
    (vla-put-YScaleFactor blockRefObj (+ currYScaleFactor 2))
    (vla-put-ZScaleFactor blockRefObj (+ currZScaleFactor 2))
    (vla-ZoomAll acadObj)
    (alert (strcat "新しいブロックの倍率は" 
                   (rtos (vla-get-XScaleFactor blockRefObj) 2) ","
                   (rtos (vla-get-YScaleFactor blockRefObj) 2) ","
                   (rtos (vla-get-ZScaleFactor blockRefObj) 2) ","
           ))
)

関連事項