Sponsored links

【AutoLISP サンプル】Lesson記事に出てきたコマンド

Sponsored links
Sponsored links
Sponsored links

座標系変更

UCS(ユーザ座標系)を変更して名前を付ける

(defun c:UCS-Jagaimo ()
  
  (if (= 0 (getvar "UCSFOLLOW"))
   (progn 

     (setvar "UCSFOLLOW" 1)
     (alert "UCSFOLLOW をオンにしました")

  )) ; progn if
    
     (command-s "._UCS" pause pause pause )
     (command-s "._UCS" "NA" "S" "Jagaimo View")	

(princ))

UCS(ユーザ座標系)をワールド座標系に戻す

(defun c:world ()
  (command-s "._UCS" "_W")	
(princ))

画層を作るコマンド

(defun c:MkLy ()

 (command-s "._LAYER" 
            "N" "Jaga-No_Plot" ;[新規作成(N)] 
            "L" "CONTINUOUS" "Jaga-No_Plot" ; [線種設定(L)] CONTINUOUS
            "C" "171" "Jaga-No_Plot" ; [色設定(C)] 171
            "P" "N" "Jaga-No_Plot" ; [印刷(P)] No Plot
            "") ;スペースキー(エンター)で終了

(princ));defun

外部参照リロード

(defun c:xx ()	
  (command-s "._-xref" "_R" "*")
(princ));defun

図形の表示/非表示

h(defun c:HH ()
   (command-s "._HIDEOBJECTS")
(princ))

;------------------------------

(defun C:HHC ()
   (command-s "._UNISOLATEOBJECTS")
(princ))

選択した図形の画層の色を変える

(defun c:LyCol1 ( / Obj Ent Ly)

  (setq Obj (car (entsel)))
      (setq Ent (entget Obj))
         (setq Ly (cdr (assoc 8 Ent)))
  
  (command-s ".-LAYER" "C" 1 Ly "" )

(princ))

選択した図形の色を変える

(defun c:C1 ( / Obj)
  

  (setq Obj (car (entsel)))
  
  (command-s "._CHANGE" Obj "" "p" "c" 1 "") 
(princ))

選択した図形の色を変える フィルター付き

(defun c:Test ()	
  (setq Objs (ssget '((0 . "*TEXT,*LINE"))))
 (command-s "._change" Objs "" "p" "c" "1" "")
(princ))
Sponsored links
Sponsored links
Sponsored links