「Vlax-get-acad-object」の版間の差分
細編集の要約なし |
細編集の要約なし |
||
| 71行目: | 71行目: | ||
</pre> | </pre> | ||
----- | |||
関連事項 | |||
* [[vla-get-activedocument]] | |||
* [[vla-get-application]] | |||
* [[vla-get-caption]] | |||
* [[vla-get-documents]] | |||
* [[vla-get-fullname]] | |||
* [[vla-get-height]] | |||
* [[vla-get-hwnd]] | |||
* [[vla-get-hwnd32]] | |||
* [[vla-get-localeid]] | |||
* [[vla-get-menubar]] | |||
* [[vla-get-menugroups]] | |||
* [[vla-get-name]] | |||
* [[vla-get-path]] | |||
* [[vla-get-preferences]] | |||
* [[vla-get-statusid]] | |||
* [[vla-get-vbe]] | |||
* [[vla-get-version]] | |||
* [[vla-get-visible]] | |||
* [[vla-get-width]] | |||
* [[vla-get-windowleft]] | |||
* [[vla-get-windowstate]] | |||
* [[vla-get-windowtop]] | |||
* [[vla-put-activedocument]] | |||
* [[vla-put-application]] | |||
* [[vla-put-caption]] | |||
* [[vla-put-documents]] | |||
* [[vla-put-fullname]] | |||
* [[vla-put-height]] | |||
* [[vla-put-hwnd]] | |||
* [[vla-put-hwnd32]] | |||
* [[vla-put-localeid]] | |||
* [[vla-put-menubar]] | |||
* [[vla-put-menugroups]] | |||
* [[vla-put-name]] | |||
* [[vla-put-path]] | |||
* [[vla-put-preferences]] | |||
* [[vla-put-statusid]] | |||
* [[vla-put-vbe]] | |||
* [[vla-put-version]] | |||
* [[vla-put-visible]] | |||
* [[vla-put-width]] | |||
* [[vla-put-windowleft]] | |||
* [[vla-put-windowstate]] | |||
* [[vla-put-windowtop]] | |||
[[Category:AutoLISP]] | [[Category:AutoLISP]] | ||
2013年11月30日 (土) 18:54時点における版
- 構文
- (vlax-get-acad-object)
- 機能
- 現在の CAD セッションのトップ レベルの CAD アプリケーション オブジェクトを取得する。
- 引数
-
- なし
- 戻り値
- CAD の VLA オブジェクト。
- サンプル
(setq aa (vlax-get-acad-object))
#<VLA-OBJECT IAcadApplication 00b3b91c>
(vlax-dump-object aa)
; IAcadApplication: An instance of the AutoCAD application
; プロパティの値:
; ActiveDocument = #<VLA-OBJECT IAcadDocument 000000002f023940>
; Application (RO) = #<VLA-OBJECT IAcadApplication 00000001401e91d8>
; Caption (RO) = "AutoCAD 2012 - [xxx.dwg]"
; Documents (RO) = #<VLA-OBJECT IAcadDocuments 000000002fdf0780>
; FullName (RO) = "C:\\Program Files\\Autodesk\\AutoCAD 2012\\acad.exe"
; Height = 1064
; HWND (RO) = 2887386
; HWND32 (RO) = 2887386
; LocaleId (RO) = 1041
; MenuBar (RO) = #<VLA-OBJECT IAcadMenuBar 000000002fdef828>
; MenuGroups (RO) = #<VLA-OBJECT IAcadMenuGroups 0000000008566d20>
; Name (RO) = "AutoCAD"
; Path (RO) = "C:\\Program Files\\Autodesk\\AutoCAD 2012"
; Preferences (RO) = #<VLA-VBA システムを初期化中...OBJECT IAcadPreferences
000000002f765418>
; StatusId (RO) = ...インデックス化された中身が見つかりません...
; VBE (RO) = #<VLA-OBJECT VBE 0000000033d77e18>
; Version (RO) = "18.2s (LMS Tech)"
; Visible = -1
; Width = 1938
; WindowLeft = -9
; WindowState = 3
; WindowTop = -9
T
; ------------------------------------------------------
; Application オブジェクトとか Active Document とか
; オブジェクトのルートに近いところを頻繁に呼び出すと遅くなるので、
; グローバル変数にしといてコントロールするとよさげ。
(setq *acad-object* nil) ; 初期化
(defun acad-object ()
; CAD オブジェクトの取得
(cond (*acad-object*) ; 値を返す-取ってなかったら取得
(T (setq *acad-object* (vlax-get-acad-object)) )))
(setq *actdoc* nil) ; 初期化
(defun active-document ()
(cond (*actdoc*) ; 値を返す-取ってなかったら取得
(T (setq *actdoc* (vla-get-activedocument (acad-object))) )))
(setq *mspace* nil) ; 初期化
(defun model-space ()
(cond (*mspace*) ; 値を返す-取ってなかったら取得
(T (setq *mspace* (vla-get-modelspace (active-document))) )))
関連事項
- vla-get-activedocument
- vla-get-application
- vla-get-caption
- vla-get-documents
- vla-get-fullname
- vla-get-height
- vla-get-hwnd
- vla-get-hwnd32
- vla-get-localeid
- vla-get-menubar
- vla-get-menugroups
- vla-get-name
- vla-get-path
- vla-get-preferences
- vla-get-statusid
- vla-get-vbe
- vla-get-version
- vla-get-visible
- vla-get-width
- vla-get-windowleft
- vla-get-windowstate
- vla-get-windowtop
- vla-put-activedocument
- vla-put-application
- vla-put-caption
- vla-put-documents
- vla-put-fullname
- vla-put-height
- vla-put-hwnd
- vla-put-hwnd32
- vla-put-localeid
- vla-put-menubar
- vla-put-menugroups
- vla-put-name
- vla-put-path
- vla-put-preferences
- vla-put-statusid
- vla-put-vbe
- vla-put-version
- vla-put-visible
- vla-put-width
- vla-put-windowleft
- vla-put-windowstate
- vla-put-windowtop