「Vla-get-momentofinertia」の版間の差分
(ページの作成:「{{AutoLISP}} ; 構文 : (vla-get-momentofinertia ''vla-object'' ) ; 機能 : ソリッドの慣性モーメントを取得する。 ; 引数 :* vla-object … VLAオ...」) |
細編集の要約なし |
||
| 57行目: | 57行目: | ||
* [[vlax-get-acad-object]] | * [[vlax-get-acad-object]] | ||
* [[vla-get-activedocument]] | * [[vla-get-activedocument]] | ||
* [[vla-get-momentofinertia]] | |||
* [[vla-get-principalmoments]] | |||
[[Category:AutoLISP]] | [[Category:AutoLISP]] | ||
2016年2月22日 (月) 17:54時点における最新版
- 構文
- (vla-get-momentofinertia vla-object )
- 機能
- ソリッドの慣性モーメントを取得する。
- 引数
-
- vla-object … VLAオブジェクト(3DSolid、Region)
- 戻り値
- 現在の座標系に基づいた 3D 座標
- MEMO:慣性モーメントは、バリアント型で定義された X、Y、Z 座標で返される。
- サンプル
(vl-load-com)
(defun c:Example_MomentOfInertia()
;; ボックスを作成してソリッドの慣性モーメントを取得するサンプル
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; box の定義
(setq center (vlax-3d-point 5 5 0)
boxLength 5
boxWidth 7
boxHeight 10)
;; box (3DSolid) を作成する
(setq modelSpace (vla-get-ModelSpace doc))
(setq boxObj (vla-AddBox modelSpace center boxLength boxWidth boxHeight))
;; 変更する
(setq NewDirection (vlax-3d-point -1 -1 1))
(setq activeViewport (vla-get-ActiveViewport doc))
(vla-put-Direction activeViewport NewDirection)
(vla-put-ActiveViewport doc activeViewport)
(vla-ZoomAll acadObj)
;; 戻す
(setq momentOfInertia (vlax-variant-value (vla-get-MomentOfInertia boxObj)))
(alert (strcat "ボックスの慣性モーメントは "
(rtos (vlax-safearray-get-element momentOfInertia 0) 2) ", "
(rtos (vlax-safearray-get-element momentOfInertia 1) 2) ", "
(rtos (vlax-safearray-get-element momentOfInertia 2) 2)))
)
関連事項