Vla-movetotop
- 構文
- (vla-movetotop vla-object Objects )
- 機能
- 表示順序で、再前面にオブジェクトを移動する。
- 引数
-
- vla-object … SortentsTable のVLAオブジェクト
- Objects … 移動するオブジェクト。
- 戻り値
- nil
- サンプル
(vl-load-com) (defun c:Example_SortentsTable() ;; 表示順序を変更するサンプル (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq modelSpace (vla-get-ModelSpace doc)) ;; 線の太さを表示し、True Color オブジェクトを作成する図面を設定。 (vla-put-LineWeightDisplay (vla-get-Preferences doc) :vlax-true) (setq MyColorObjOne (vlax-create-object "AutoCAD.AcCmColor.20")) (vla-SetRGB MyColorObjOne 80 100 244) ;; ポリラインを作成 (setq points (vlax-make-safearray vlax-vbDouble '(0 . 8))) (vlax-safearray-fill points '(4 4 0 3 5 0 6 20 0 ) ) (setq plineObj (vla-AddPolyline modelSpace points)) (vla-put-Lineweight plineObj acLnWt211) (vla-SetRGB MyColorObjOne 90 110 150) (vla-put-TrueColor plineObj MyColorObjOne) ;; 線分を作成 (setq startPoint (vlax-3d-point 5 13 0) endPoint (vlax-3d-point 5 27 0)) (setq lineObj (vla-AddLine modelSpace startPoint endPoint)) (vla-put-Lineweight lineObj acLnWt211) (vla-SetRGB MyColorObjOne 50 80 230) (vla-put-TrueColor lineObj MyColorObjOne) ;; 円を作成 (setq centerPoint (vlax-3d-point 10 15 0) radius 5) (setq circleObj (vla-AddCircle modelSpace centerPoint radius)) (vla-put-Lineweight circleObj acLnWt211) (vla-SetRGB MyColorObjOne 60 200 220) (vla-put-TrueColor circleObj MyColorObjOne) (vla-ZoomAll acadObj) (vla-Update acadObj) ;; 拡張ディクショナリを取得し、必要な場合は、SortentsTable オブジェクトを追加 (setq eDictionary (vla-GetExtensionDictionary modelSpace)) ;; 例外をスローから GetObject 呼び出しの失敗を防ぐ (setq sentityObj (vl-catch-all-apply 'vla-GetObject (list eDictionary "ACAD_SORTENTS"))) (if (= (type sentityObj)'VL-CATCH-ALL-APPLY-ERROR) ;; No SortentsTable object, so add one (setq sentityObj (vla-AddObject eDictionary "ACAD_SORTENTS" "AcDbSortentsTable")) ) (setq ObjIds (vlax-make-safearray vlax-vbLong '(0 . 2))) (vlax-safearray-put-element ObjIds 0 (vla-get-ObjectID plineObj)) (vlax-safearray-put-element ObjIds 1 (vla-get-ObjectID lineObj)) (vlax-safearray-put-element ObjIds 2 (vla-get-ObjectID circleObj)) (setq varObject circleObj) (setq arr (vlax-make-safearray vlax-vbObject '(0 . 0))) (vlax-safearray-put-element arr 0 varObject) ;; 円を最背面に変更 (vla-MoveToBottom sentityObj arr) (vla-Update acadObj) (alert "円を再背面に変更") ;; 線分を円の背面に変更 (vla-MoveTobelow sentityObj arr lineObj) (vla-Update acadObj) (alert "線分を円の背面に変更") ;; 円を最前面に変更 (vla-MoveToTop sentityObj arr) (vla-Update acadObj) (alert "円を最前面に変更") (vlax-release-object MyColorObjOne) )
関連事項