Vla-put-weights
- 構文
- (vla-put-weights vla-object weights)
- 機能
- スプラインの重みベクトルを指定する。
- 引数
- 
- vla-object … Spline の VLAオブジェクト
- weights … スプラインの重みベクトル。
 
- 戻り値
- nil
- サンプル
(vl-load-com)
(defun c:Example_Weights()
    ;; スプラインを作成して、スプラインベクトルの重さを変更するサンプル
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    ;; スプラインの定義
    (setq startTan (vlax-3d-point 0.5 0.5 0)
          endTan (vlax-3d-point 0.5 0.5 0)
         fitPoints (vlax-make-safearray vlax-vbDouble '(0 . 8)))
    (vlax-safearray-fill fitPoints '(0 0 0
				     5 5 0
				     10 0 0
				    )
    )
    
    ;; スプラインを作成
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq splineObj (vla-AddSpline modelSpace fitPoints startTan endTan))
    (vla-ZoomAll acadObj)
        
    ;; スプラインの重さをセット。vla-put-weights は使ってない!
    (vla-SetWeight splineObj 0 1.5)
    (vla-SetWeight splineObj 1 2)
    (vla-SetWeight splineObj 2 4.5)
    
    (vla-ZoomAll acadObj)
    
    ;; 新しいスプラインベクトルの重さを表示
    (setq weightVector (vlax-variant-value (vla-get-Weights splineObj)))
    (alert (strcat "The 新しいスプラインベクトルの重さは: "
                   "\n" (rtos (vlax-safearray-get-element weightVector 0) 2)
                   "\n" (rtos (vlax-safearray-get-element weightVector 1) 2)
                   "\n" (rtos (vlax-safearray-get-element weightVector 2) 2)))
)
関連事項
