logo

한국어

칼럼

    오늘:
    12
    어제:
    85
    전체:
    336,362

(defun c:xyout( )
 ;/ n xylist f x y pt1 pnxy1 pnxy2 pnxy3 pnxy num )

 (setq case (getint "1:Auto num  2:pick num ") )  
 
 (setq xylist (list ""))
 (setq n 1)

 (if (= case 1) ; -- auto num mode 

       (progn
               (setq pt1 (list ""))
               (setq numtemp (getint "시작번호:" ))                           
               (while (/= pt1 nil) ; -- 탈출조건
                  (print numtemp )
                  (setq num (rtos numtemp 2 3))               
                  (pting)
                  (setq numtemp (+ numtemp 1) )
               ); -- end while               
       ); -- end progn
 ); -- end if


 (if (= case 2) ; -- pick num mode 

       (progn
               (while (/= selnum nil)
                 ( picknum )
                 ( pting )
               ); -- end while

       ); -- end progn
 );---end if


 (printfile)


);---end main defun

 

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

(defun picknum()

 (setq selnum "")

  (setq selnum (entsel "번호 :" ) )

   (if (/= selnum nil)
 
        (progn     (setq num 
                          (cdr 
                            (assoc 1 
                              (entget
                                  (car 
                                      selnum   
                                  );--end car
                              );--end entget
                            );--end assoc 1
                          );--end cdr
                    );--end setq
         );---end progn
   );---end if

);---end pick num


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


(defun pting(); -- 점찍어서 리스트에 축척

  (setq pt1 (getpoint "점 찍어라.." )) (terpri)
  (setq x (car  pt1))
  (setq y (cadr pt1))
  (setq z (last pt1))
  (setq xylist (append xylist (list (atof num) x y z))) 

);---end pting

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

( defun printfile()
 
 (setq f (open (getstring "\n화일이름 <xx.xxx>: ") "w")) 
   
 (setq n 1)
 (repeat (/ (- (length xylist) 4) 4)
   (setq pnxy1 (rtos (nth n xylist)))
   (setq pnxy2 (rtos (nth (+ n 1) xylist)))
   (setq pnxy3 (rtos (nth (+ n 2) xylist)))
   (setq pnxy4 (rtos (nth (+ n 3) xylist))) 
   (setq pnxy (strcat "\n" pnxy1 "," pnxy2 "," pnxy3 "," pnxy4))
   (princ pnxy f)
   (setq n (+ n 4)) 
 );--end repeat

 (close f)

);---end printfile

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

번호 제목 글쓴이 날짜 조회 수
90 G10 기능 FANUC- MCT com4uinc 2021.07.08 554
89 코드의 범위와 자료형 file com4uinc 2021.06.25 60
88 DXF CODE file com4uinc 2021.06.25 48
87 AUTOCAD 엑셀과 연동 com4uinc 2021.04.30 52
86 캐드의 시스템을 초기화 com4uinc 2021.01.20 73
85 여러 개의 라인들을 하나의 폴리라인으로 com4uinc 2021.01.20 63
84 수평 NC 선반의 좌표값을 도면에 표시 com4uinc 2021.01.20 74
83 선택한 객체의 entity정보와 object정보를 표시 com4uinc 2021.01.20 50
82 라인들을 하나의 폴리라인으로 com4uinc 2021.01.20 70
81 대각 치수 따기 com4uinc 2021.01.20 68
80 두면이 이루는 각도를 계산한다. com4uinc 2021.01.20 59
79 시계방향으로 도는지 반시계로 도는지를 계산하는 함수 com4uinc 2021.01.20 47
» 캐드 DATA를 엑셀파일로 출력하는 LISP 프로그램 com4uinc 2021.01.08 82
77 TABLE을 작성 com4uinc 2019.09.25 154
76 ARC 시작점과 끝점구하기 com4uinc 2019.09.25 134
75 2次元CAMソフトウェア『DieFA GrCAM』機能紹介②切削加工NCデータ作成例 粗取り加工作成例(切込加工) com4uinc 2017.04.05 119
74 2次元CAMソフトウェア『DieFA GrCAM』機能紹介④研削加工NCデータ作成 複数ワーク 株式会社イワシタIG-SR102向け com4uinc 2017.04.05 85
73 2次元CAMソフトウェア『Okamoto UPCAM』機能紹介②切削加工NCデータ作成例(カッターパス表示) com4uinc 2017.04.05 74
72 2次元CAMソフトウェア『Okamoto UPCAM』機能紹介⑤NCデータ加工例(オフセット加工) com4uinc 2017.04.05 80
71 2次元CAMソフトウェア『Okamoto UPCAM』機能紹介④砥石成形加工例(砥石移動) com4uinc 2017.04.05 77