「Vla-addline」の版間の差分
(ページの作成:「{{AutoLISP}} ; 構文 : (vla-addline ''vla-object'' ''pt1'' ''pt2'') ; 機能 : 線分を作図する。 ; 引数 :* vla-object … 生成する空間のVLAオブ...」) |
細編集の要約なし |
||
(同じ利用者による、間の1版が非表示) | |||
26行目: | 26行目: | ||
(defun c:cm-addline () | (defun c:cm-addline () | ||
(setq pt1 (getpoint "\n始点: ")) | (setq pt1 (getpoint "\n始点: ")) | ||
(setq pt2 (getpoint "\ | (setq pt2 (getpoint "\n終点: " pt1)) | ||
(command "._line" pt1 pt2 "") | (command "._line" pt1 pt2 "") | ||
) | ) | ||
; コマンドで線分追加(VLコマンド版) | |||
(vl-cmdf "._line" (getpoint "始点:") (getpoint "終点:") "") | |||
; entmakeで線分追加 | ; entmakeで線分追加 | ||
(defun c:em-addline () | (defun c:em-addline () | ||
(setq pt1 (getpoint "\n始点: ")) | (setq pt1 (getpoint "\n始点: ")) | ||
(setq pt2 (getpoint "\ | (setq pt2 (getpoint "\n終点: " pt1)) | ||
(entmake | (entmake | ||
'((0 . "LINE") | '((0 . "LINE") | ||
46行目: | 51行目: | ||
(setq mspace (vla-get-modelspace *actdoc*)) | (setq mspace (vla-get-modelspace *actdoc*)) | ||
(setq pt1 (getpoint "\n始点: ")) | (setq pt1 (getpoint "\n始点: ")) | ||
(setq pt2 (getpoint "\ | (setq pt2 (getpoint "\n終点: " pt1)) | ||
(setq myline (vla-addline mspace (vlax-3d-point pt1)(vlax-3d-point pt2))) | (setq myline (vla-addline mspace (vlax-3d-point pt1)(vlax-3d-point pt2))) | ||
(princ) | (princ) | ||
);defun | ) ;defun | ||
(princ) | (princ) | ||
60行目: | 65行目: | ||
(setq util (vla-get-utility *actdoc*)) | (setq util (vla-get-utility *actdoc*)) | ||
(setq pt1 (vla-getpoint util nil "\n始点 : ")) | (setq pt1 (vla-getpoint util nil "\n始点 : ")) | ||
(setq pt2 (vla-getpoint util pt1 "\ | (setq pt2 (vla-getpoint util pt1 "\n終点 : ")) | ||
(setq myline (vla-addline mspace pt1 pt2)) | (setq myline (vla-addline mspace pt1 pt2)) | ||
(princ) | (princ) | ||
);defun | ) ;defun | ||
</pre> | </pre> |
2013年4月2日 (火) 10:32時点における最新版
- 構文
- (vla-addline vla-object pt1 pt2)
- 機能
- 線分を作図する。
- 引数
-
- vla-object … 生成する空間のVLAオブジェクト
- pt1 … 始点の3Dポイント
- pt2 … 終点の3Dポイント
- 戻り値
- 作成した線分のVLAオブジェクト
- サンプル
; コマンドで線分追加 (command "._line" pause pause "") ; コマンドで線分追加(変数利用版) (defun c:cm-addline () (setq pt1 (getpoint "\n始点: ")) (setq pt2 (getpoint "\n終点: " pt1)) (command "._line" pt1 pt2 "") ) ; コマンドで線分追加(VLコマンド版) (vl-cmdf "._line" (getpoint "始点:") (getpoint "終点:") "") ; entmakeで線分追加 (defun c:em-addline () (setq pt1 (getpoint "\n始点: ")) (setq pt2 (getpoint "\n終点: " pt1)) (entmake '((0 . "LINE") (cons 10 pt1) (cons 11 pt2) (210 0.0 0.0 1.0) ))) ; VLA で線分追加(適当にactivex版) (defun c:ax-addline () (vl-load-com) (setq *actdoc* (vla-get-activedocument (vlax-get-acad-object))) (setq mspace (vla-get-modelspace *actdoc*)) (setq pt1 (getpoint "\n始点: ")) (setq pt2 (getpoint "\n終点: " pt1)) (setq myline (vla-addline mspace (vlax-3d-point pt1)(vlax-3d-point pt2))) (princ) ) ;defun (princ) ;------------------------------- ; VLA で線分追加(ActiveX的版) (defun c:ax-addline1 () (vl-load-com) (setq *actdoc* (vla-get-activedocument (vlax-get-acad-object))) (setq mspace (vla-get-modelspace *actdoc*)) (setq util (vla-get-utility *actdoc*)) (setq pt1 (vla-getpoint util nil "\n始点 : ")) (setq pt2 (vla-getpoint util pt1 "\n終点 : ")) (setq myline (vla-addline mspace pt1 pt2)) (princ) ) ;defun
関連事項