Vla-put-secondpoint
- 構文
- (vla-put-secondpoint vla-object point )
- 機能
- 放射線または構築線の 2 番目の点を指定する。
- 引数
-
- vla-object … VLAオブジェクト(Ray、XLine)
- point … 放射線、構築線の 2 番目の点を表す 3D WCS 座標
- 戻り値
- nil
- 放射線の 2 番目の点には、基点と等しい点を設定することはできない。
- サンプル
(vl-load-com)
(defun c:Example_SecondPoint()
;; 放射線を作図して第二点を変更するサンプル
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; 放射線の定義
(setq basePoint (vlax-3d-point 3 3 0)
directionVec (vlax-3d-point 1 1 0))
;; 放射線を作成
(setq modelSpace (vla-get-ModelSpace doc))
(setq rayObj (vla-AddRay modelSpace basePoint directionVec))
(vla-Regen doc :vlax-true)
(alert "放射線作ったよ。")
;; 第二点を変更
(setq newSecondPoint (vlax-3d-point 4 2 0))
;; 更新
(vla-put-SecondPoint rayObj newSecondPoint)
;; 取得
(setq currSecondPoint (vlax-safearray->list (vlax-variant-value (vla-get-SecondPoint rayObj))))
(setq msg (strcat (rtos (nth 0 currSecondPoint) 2) ", "
(rtos (nth 1 currSecondPoint) 2) ", "
(rtos (nth 2 currSecondPoint) 2)))
(vla-Regen doc :vlax-true)
(alert (strcat "放射線の新しい第二点は : " msg))
)
関連事項