Author Topic: Help with lisp : Convert *.txt file to leica *.gsi16  (Read 4305 times)

0 Members and 1 Guest are viewing this topic.

pedroantonio

  • Guest
Help with lisp : Convert *.txt file to leica *.gsi16
« on: April 12, 2019, 06:10:14 AM »
Hi i find a lisp code to convert a polyline to   leica *.gsi16  file and isert numbers on polyline vertex. I want to convert this code. I want to give  a txt file with P,X,Y,Z and convert it to gsi file and i dont want to select polyline and insert numbers . I appload a txt file and a gsi file.My total station is the TCR805.
And if in my txt file i dont have elevetion z for example
Quote
1,304135.864,4231008.896,87.774,

Then add elevetion 100 not 0

And something else

Code: [Select]
in my gsi files  i have 
*110014+00000000000000S3 81..10+0000000309391415 82..10+0000004241392796 83..10+0000000000104304

and in this lisp code i have
*110014+00000000000000S3 81...0+0000000309391415 82...0+0000004241392796 83...0+0000000000104304

Code - Auto/Visual Lisp: [Select]
  1. ;;;Οπξγπΰμΰ ηΰοθρθ κξξπδθνΰς ςξχεκ οξλθλθνθθ β τΰιλ ρ 3 ηνΰκΰμθ β τξπμΰςε LEICA GSI16
  2. ;;;δεκΰαπό 2015
  3. ;;;Εγξπξβ Ν.Β.
  4.  
  5. ;ss_nab νΰαξπ ξαϊεκςξβ
  6. ;sp_vrtx ροθρξκ ςξχεκ
  7.  
  8. (defun c:exp_gsi ( / num count_g count sp_vrtx ss_nab fl_name ff fl ok pref N x y z txt)
  9.   (princ "Βϋαεπθςε οξλθλθνθθ δλ βϋνξρΰ")
  10.  (setq ss_nab (ssget'((0 . "LWPOLYLINE"))))
  11.   (setq N 0)
  12.     (setq z (rtos 0))
  13.  (setq fl_name (getfiled "Ρξυπΰνενθε τΰιλΰ" (getvar "DWGPREFIX") "gsi" 1))
  14.  
  15.  (if(= fl_name nil)(alert "Νεβϋαπΰν τΰιλ δλ ηΰοθρθ"))
  16.  
  17.  
  18.  (if(/= fl_name nil)(progn;σρλξβθε νΰ βϋαξπ τΰιλΰ
  19. (if (findfile fl_name)(setq ff 1)(setq ff 0));
  20.  
  21. (if ( = 1 ff)(progn;ερλθ τΰιλ ρσωερςβσςες
  22.    (initget "Δξοθρΰςό Οεπεηΰοθρό")
  23.   (setq ff(GETKWORD "\n&#916;&#944;&#957;&#957;&#971;&#953; &#964;&#944;&#953;&#955; &#963;&#950;&#949; &#961;&#963;&#969;&#949;&#961;&#962;&#946;&#963;&#949;&#962; &#946;&#971;&#945;&#949;&#960;&#952;&#962;&#949; &#948;&#949;&#953;&#961;&#962;&#946;&#952;&#949; [&#916;&#958;&#959;&#952;&#961;&#944;&#962;&#972;/&#927;&#949;&#960;&#949;&#951;&#944;&#959;&#952;&#961;&#972;]<&#916;&#958;&#959;&#952;&#961;&#944;&#962;&#972;>"))
  24.    (if (or(null ff)(= ff "&#916;&#958;&#959;&#952;&#961;&#944;&#962;&#972;")) (setq fl(open fl_name "a")))
  25.    (if(= ff "&#927;&#949;&#960;&#949;&#951;&#944;&#959;&#952;&#961;&#972;")(setq fl(open fl_name "w")))
  26.    ));&#954;&#958;&#957;&#949;&#966; &#963;&#961;&#955;&#958;&#946;&#952;&#63739; &#964;&#944;&#953;&#955; &#961;&#963;&#969;&#949;&#961;&#962;&#946;&#963;&#962;&#949;&#962;
  27.  
  28.  (if ( = 0 ff)(setq fl(open fl_name "w")));&#949;&#961;&#955;&#952; &#964;&#944;&#953;&#955; &#957;&#958;&#946;&#971;&#953;  
  29.  
  30.   (setq pref (getstring "\n&#914;&#946;&#949;&#948;&#952;&#962;&#949; &#959;&#960;&#949;&#964;&#952;&#954;&#961;: "))
  31.   (if (= pref nil)(setq pref "1"));end if
  32.  ; (setq ok (getint "\n&#914;&#946;&#949;&#948;&#952;&#962;&#949; &#954;&#958;&#955;&#952;&#967;&#949;&#961;&#962;&#946;&#958; &#951;&#957;&#944;&#954;&#958;&#946; &#959;&#958;&#961;&#955;&#949; &#951;&#944;&#959;&#63739;&#962;&#958;&#953; &#946; &#954;&#958;&#958;&#960;&#948;&#952;&#957;&#944;&#962;&#944;&#965;  <3>:"))
  33.   (if (= ok nil)(setq ok 3));end if
  34.   (setq count_g 0);&#947;&#955;&#958;&#945;&#944;&#955;&#972;&#957;&#971;&#953; &#961;&#967;&#949;&#962;&#967;&#952;&#954;
  35.    (repeat (SSLENGTH ss_nab); &#934;&#920;&#922;&#923;
  36.     (setq sp_vrtx(get-pline-list-vertext(ssname ss_nab N)))
  37.    (setq count 0)
  38.   (repeat(LENGTH sp_vrtx);&#966;&#952;&#954;&#955; &#959;&#958; &#962;&#958;&#967;&#954;&#944;&#956;
  39.           (setq pt_p (nth count sp_vrtx))
  40.    ; (setq x(distof(rtos(nth 1 pt_p)2 3)1))
  41. ;(setq y(distof(rtos(nth 0 pt_p)2 3)1))
  42.      
  43.           (setq x(to_gsi (nth 1 pt_p)))
  44.           (setq y(to_gsi (nth 0 pt_p)))
  45.    
  46.    ;(command "_point" pt_p "")
  47.    (entmake(list'(0 . "POINT")(cons 10 pt_p)'(8 . "&#946;&#971;&#957;&#958;&#961;")));end entmake
  48.    
  49.      ; (command "_TEXT" pt_p 0.5 "0" (strcat pref(itoa N) "-" (itoa(+ count 1))))
  50. ;;;    (command "_TEXT" pt_p 0.5 "0" (strcat pref "." (itoa(+ count_g 1))))
  51.     (setq txt(strcat pref "." (itoa(+ count_g 1))))
  52.     (list
  53.       (cons 0 "TEXT")
  54.       (cons 8 "&#946;&#971;&#957;&#958;&#961;")
  55.       (cons 10 pt_p)
  56.       (cons 11 pt_p)
  57.       (cons 40 0.5)
  58.       (cons 1 txt)
  59.       (cons 50 0)
  60.       (cons 7 "Standard")
  61.       (cons 71 0)
  62.       (cons 72 1)
  63.       (cons 73 0)
  64.     ))
  65.    
  66.   ; (setq x(nth 1 pt_p))
  67.   ; (setq y(nth 0 pt_p))
  68.  
  69.     ;&#951;&#944;&#959;&#952;&#961;&#972; &#946; &#964;&#944;&#953;&#955;
  70.     (setq num(strcat pref "." (itoa(+ count_g 1))))
  71.       (repeat (- 16(strlen num));&#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#949; &#957;&#963;&#955;&#949;&#953;
  72.     (setq num(strcat "0" num))
  73.     );&#954;&#958;&#957;&#949;&#966; &#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#63739; &#957;&#963;&#955;&#949;&#953;
  74.    
  75.       (princ
  76.         (strcat "*" (rtos (+ 110000 count_g 1) 2 0) "+" num)
  77.         fl)
  78.     (write-char 32 fl)(princ (strcat "81..." y) fl)(write-char 32 fl)(princ (strcat "82..." x) fl)(write-char 32 fl)(princ "83...0+0000000000000001" fl)(write-char 32 fl)(write-char 10 fl)
  79.          ; (setq num (+ num 1));&#952;&#957;&#954;&#960;&#949;&#956;&#949;&#957;&#962; &#959;&#952;&#954;&#949;&#962;&#958;&#946;
  80.           (setq count (+ count 1)); &#952;&#957;&#954;&#960;&#949;&#956;&#949;&#957;&#962; &#962;&#958;&#967;&#949;&#954;
  81.     (setq count_g (+ count_g 1)); &#947;&#955;&#958;&#945;&#944;&#955;&#972;&#957;&#971;&#953; &#952;&#957;&#954;&#960;&#949;&#956;&#949;&#957;&#962; &#962;&#958;&#967;&#949;&#954;
  82.                   );&#954;&#958;&#957;&#949;&#966; &#966;&#952;&#954;&#955;&#944; &#959;&#958; &#962;&#958;&#967;&#954;&#944;&#956;
  83.  ;(write-char 10 fl)
  84.   ;(prin1(strcat"&#927;&#949;&#960;&#952;&#956;&#949;&#962;&#960;: "(rtos (getvar "perimeter")2 0) " &#956;.") fl)(write-char 10 fl)
  85.   ;(prin1(strcat"&#916;&#958;&#959;. &#959;&#958;&#947;&#960;&#949;&#968;&#957;&#958;&#961;&#962;&#972;: "(rtos(*(sqrt(getvar "AREA"))(* 3.5 fdop))2 0) " &#954;&#946;.&#956;.") fl)(write-char 10 fl)
  86.      
  87.      
  88.      (SETQ N (+ N 1))
  89.      ); &#922;&#926;&#925;&#917;&#934; &#934;&#920;&#922;&#923;&#912;
  90.   ))
  91.    (close fl)
  92.   (setvar "cmdecho" 0)
  93.   (alert (strcat "&#941;&#954;&#961;&#959;&#958;&#960;&#962; &#946; &#964;&#944;&#953;&#955; " fl_name  " &#951;&#944;&#946;&#949;&#960;&#968;&#949;&#957;"))
  94.  
  95.   );end defun
  96.  
  97.  
  98. ;;; &#932;&#963;&#957;&#954;&#966;&#952;&#63739; &#946;&#958;&#951;&#946;&#960;&#944;&#969;&#944;&#949;&#962; &#962;&#949;&#954;&#961;&#962; &#967;&#952;&#961;&#955;&#944; &#946; &#964;&#958;&#960;&#956;&#944;&#962;&#949; GSI16
  99.  
  100. (defun to_gsi (num / text)
  101.  (if (>= num 0);&#967;&#952;&#961;&#955;&#958; &#959;&#958;&#955;&#958;&#950;&#952;&#962;&#949;&#955;&#972;&#957;&#958;&#949;
  102.   (progn
  103.   (setq text (rtos(* num 1000)2 0))
  104.   (repeat (- 16(strlen text));&#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#949; &#957;&#963;&#955;&#949;&#953;
  105.     (setq text(strcat "0" text))
  106.     );&#954;&#958;&#957;&#949;&#966; &#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#63739; &#957;&#963;&#955;&#949;&#953;
  107.   (setq text(strcat "0+" text))
  108.   ));&#954;&#958;&#957;&#949;&#966; &#963;&#961;&#955;&#958;&#946;&#952;&#63739; &#959;&#958;&#955;&#958;&#950;&#952;&#962;&#949;&#955;&#972;&#957;&#958;&#947;&#958; &#967;&#952;&#961;&#955;&#944;
  109.  
  110.   (if (< num 0);&#967;&#952;&#961;&#955;&#958; &#958;&#962;&#960;&#952;&#966;&#944;&#962;&#949;&#955;&#972;&#957;&#958;&#949;
  111.     (progn
  112.   (setq text (rtos(* num -1000)2 0))
  113.   (repeat (- 16(strlen text));&#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#949; &#957;&#963;&#955;&#949;&#953;
  114.     (setq text(strcat "0" text))
  115.     );&#954;&#958;&#957;&#949;&#966; &#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#63739; &#957;&#963;&#955;&#949;&#953;
  116.   (setq text(strcat "0-" text))
  117.   ));&#954;&#958;&#957;&#949;&#966; &#963;&#961;&#955;&#958;&#946;&#952;&#63739; &#958;&#962;&#960;&#952;&#966;&#944;&#962;&#949;&#955;&#972;&#957;&#958;&#947;&#958; &#967;&#952;&#961;&#955;&#944;
  118.   text
  119.   );end defun
  120.  
  121.  
  122.    
  123.  
  124.  
  125.   ;;; &#932;&#963;&#957;&#954;&#966;&#952;&#63739; &#946;&#958;&#951;&#946;&#960;&#944;&#969;&#944;&#949;&#962; &#961;&#959;&#952;&#961;&#958;&#954; &#962;&#958;&#967;&#949;&#954; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#952; (&#958;&#945;&#955;&#949;&#947;&#967;&#949;&#957;&#957;&#958;&#953; &#955;&#952;&#945;&#958; &#961;&#962;&#944;&#957;&#948;&#944;&#960;&#962;&#957;&#958;&#953;)
  126. ;;; &#914; &#954;&#944;&#967;&#949;&#961;&#962;&#946;&#949; &#959;&#944;&#960;&#944;&#956;&#949;&#962;&#960;&#944; &#964;&#963;&#957;&#954;&#966;&#952;&#952; &#959;&#949;&#960;&#949;&#948;&#944;&#949;&#962;&#961;&#63739; &#952;&#956;&#63739; &#959;&#960;&#952;&#956;&#952;&#962;&#952;&#946;&#944;, &#946;&#958;&#951;&#946;&#960;&#944;&#969;&#944;&#949;&#962;&#961;&#63739; &#961;&#959;&#952;&#961;&#958;&#954; &#952;&#951;
  127. ;;; &#948;&#946;&#963;&#965;&#956;&#949;&#960;&#957;&#971;&#965; (&#948;&#955;&#63739; &#958;&#945;&#955;&#949;&#947;&#967;&#949;&#957;&#957;&#958;&#953; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#952;) &#952;&#955;&#952; &#962;&#960;&#949;&#965;&#956;&#949;&#960;&#957;&#971;&#965; (&#948;&#955;&#63739; &#961;&#962;&#944;&#957;&#948;&#944;&#960;&#962;&#957;&#958;&#953;) &#946; &#962;&#958;&#956; &#959;&#958;&#960;&#63739;&#948;&#954;&#949;,
  128. ;;; &#946; &#954;&#958;&#962;&#958;&#960;&#958;&#956; &#958;&#957;&#952; &#961;&#958;&#948;&#949;&#960;&#950;&#944;&#962;&#961;&#63739; &#946; &#958;&#959;&#952;&#961;&#944;&#957;&#952;&#952; &#959;&#960;&#952;&#956;&#952;&#962;&#952;&#946;&#944;-&#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#952;
  129. ;;; &#952;&#955;&#952; nil, &#949;&#961;&#955;&#952; &#959;&#960;&#952;&#956;&#952;&#962;&#952;&#946; &#957;&#949; &#63739;&#946;&#955;&#63739;&#949;&#962;&#961;&#63739; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#949;&#953;
  130.  
  131. (defun get-pline-list-vertext (polylineName / polylineInfo vertexName listOfPoints)
  132. ;; &#926;&#945;&#955;&#949;&#947;&#967;&#949;&#957;&#957;&#944;&#63739; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#63739;
  133. ((= (cdr (assoc '0 (entget polylineName))) "LWPOLYLINE")
  134. (setq polylineInfo (entget polylineName))
  135. (while (vl-position (assoc '10 polylineInfo) polylineInfo)
  136. (setq listOfPoints
  137. (assoc '10 polylineInfo)
  138. polylineInfo
  139. ) ;_ vl-position
  140. polylineInfo
  141. ) ;_ nth
  142. ) ;_ cdr
  143. listOfPoints
  144. ) ;_ cons
  145. ) ;_ setq
  146. (setq polylineInfo
  147. (vl-remove (assoc '10 polylineInfo) polylineInfo)
  148. ) ;_ setq
  149. ) ;_ while
  150. )
  151. ;; &#929;&#962;&#944;&#957;&#948;&#944;&#960;&#962;&#957;&#944;&#63739; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#63739;
  152. ((= (cdr (assoc '0 (entget polylineName))) "POLYLINE")
  153. (setq vertexName (entnext polylineName))
  154. (while vertexName
  155. (if (= (cdr (assoc '0 (entget vertexName))) "VERTEX")
  156. (setq listOfPoints
  157. (assoc '10 (entget vertexName))
  158. ) ;_ cdr
  159. listOfPoints
  160. ) ;_ cons
  161. ) ;_ setq
  162. ) ;_ if
  163. (setq vertexName (entnext vertexName))
  164. ) ;_ while
  165. )
  166. ;; &#925;&#949; &#63739;&#946;&#955;&#63739;&#949;&#962;&#961;&#63739; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#949;&#953;
  167. (T
  168. (setq listOfPoints nil)
  169. )
  170. ) ;_ cond
  171. (reverse listOfPoints)
  172. ) ;_ defun
  173.  
  174.  

thanks
« Last Edit: April 12, 2019, 06:18:13 AM by Topographer »

sanju2323

  • Newt
  • Posts: 68
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #1 on: April 12, 2019, 06:39:48 AM »
I have another way but I can convert it from Excel to GIS format.
http://www.engineeringsurveyor.com/software/csv2gsi_v42.zip

pedroantonio

  • Guest
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #2 on: April 12, 2019, 10:11:01 AM »
Yes .I know about this excell but i prefer to use lisp files

pedroantonio

  • Guest
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #3 on: April 12, 2019, 07:28:44 PM »
Can any one update the  code to read a txt file and export a gsi16?

Code - Auto/Visual Lisp: [Select]
  1. ;;;&#927;&#960;&#958;&#947;&#960;&#944;&#956;&#944; &#951;&#944;&#959;&#952;&#961;&#952; &#954;&#958;&#958;&#960;&#948;&#952;&#957;&#944;&#962; &#962;&#958;&#967;&#949;&#954; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#952; &#946; &#964;&#944;&#953;&#955; &#961; 3 &#951;&#957;&#944;&#954;&#944;&#956;&#952; &#946; &#964;&#958;&#960;&#956;&#944;&#962;&#949; LEICA GSI16
  2. ;;;&#948;&#949;&#954;&#944;&#945;&#960;&#972; 2015
  3. ;;;&#917;&#947;&#958;&#960;&#958;&#946; &#925;.&#914;.
  4.  
  5. ;ss_nab &#957;&#944;&#945;&#958;&#960; &#958;&#945;&#970;&#949;&#954;&#962;&#958;&#946;
  6. ;sp_vrtx &#961;&#959;&#952;&#961;&#958;&#954; &#962;&#958;&#967;&#949;&#954;
  7.  
  8. (defun c:exp_gsi ( / num count_g count sp_vrtx ss_nab fl_name ff fl ok pref N x y z txt)
  9.   (princ "&#914;&#971;&#945;&#949;&#960;&#952;&#962;&#949; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#952; &#948;&#955;&#63739; &#946;&#971;&#957;&#958;&#961;&#944;")
  10.  (setq ss_nab (ssget'((0 . "LWPOLYLINE"))))
  11.   (setq N 0)
  12.     (setq z (rtos 0))
  13.  (setq fl_name (getfiled "&#929;&#958;&#965;&#960;&#944;&#957;&#949;&#957;&#952;&#949; &#964;&#944;&#953;&#955;&#944;" (getvar "DWGPREFIX") "gsi" 1))
  14.  
  15.  (if(= fl_name nil)(alert "&#925;&#949;&#946;&#971;&#945;&#960;&#944;&#957; &#964;&#944;&#953;&#955; &#948;&#955;&#63739; &#951;&#944;&#959;&#952;&#961;&#952;"))
  16.  
  17.  
  18.  (if(/= fl_name nil)(progn;&#963;&#961;&#955;&#958;&#946;&#952;&#949; &#957;&#944; &#946;&#971;&#945;&#958;&#960; &#964;&#944;&#953;&#955;&#944;
  19. (if (findfile fl_name)(setq ff 1)(setq ff 0));
  20.  
  21. (if ( = 1 ff)(progn;&#949;&#961;&#955;&#952; &#964;&#944;&#953;&#955; &#961;&#963;&#969;&#949;&#961;&#962;&#946;&#963;&#962;&#949;&#962;
  22.    (initget "&#916;&#958;&#959;&#952;&#961;&#944;&#962;&#972; &#927;&#949;&#960;&#949;&#951;&#944;&#959;&#952;&#961;&#972;")
  23.   (setq ff(GETKWORD "\n&#916;&#944;&#957;&#957;&#971;&#953; &#964;&#944;&#953;&#955; &#963;&#950;&#949; &#961;&#963;&#969;&#949;&#961;&#962;&#946;&#963;&#949;&#962; &#946;&#971;&#945;&#949;&#960;&#952;&#962;&#949; &#948;&#949;&#953;&#961;&#962;&#946;&#952;&#949; [&#916;&#958;&#959;&#952;&#961;&#944;&#962;&#972;/&#927;&#949;&#960;&#949;&#951;&#944;&#959;&#952;&#961;&#972;]<&#916;&#958;&#959;&#952;&#961;&#944;&#962;&#972;>"))
  24.    (if (or(null ff)(= ff "&#916;&#958;&#959;&#952;&#961;&#944;&#962;&#972;")) (setq fl(open fl_name "a")))
  25.    (if(= ff "&#927;&#949;&#960;&#949;&#951;&#944;&#959;&#952;&#961;&#972;")(setq fl(open fl_name "w")))
  26.    ));&#954;&#958;&#957;&#949;&#966; &#963;&#961;&#955;&#958;&#946;&#952;&#63739; &#964;&#944;&#953;&#955; &#961;&#963;&#969;&#949;&#961;&#962;&#946;&#963;&#962;&#949;&#962;
  27.  
  28.  (if ( = 0 ff)(setq fl(open fl_name "w")));&#949;&#961;&#955;&#952; &#964;&#944;&#953;&#955; &#957;&#958;&#946;&#971;&#953;  
  29.  
  30.   (setq pref (getstring "\n&#914;&#946;&#949;&#948;&#952;&#962;&#949; &#959;&#960;&#949;&#964;&#952;&#954;&#961;: "))
  31.   (if (= pref nil)(setq pref "1"));end if
  32.  ; (setq ok (getint "\n&#914;&#946;&#949;&#948;&#952;&#962;&#949; &#954;&#958;&#955;&#952;&#967;&#949;&#961;&#962;&#946;&#958; &#951;&#957;&#944;&#954;&#958;&#946; &#959;&#958;&#961;&#955;&#949; &#951;&#944;&#959;&#63739;&#962;&#958;&#953; &#946; &#954;&#958;&#958;&#960;&#948;&#952;&#957;&#944;&#962;&#944;&#965;  <3>:"))
  33.   (if (= ok nil)(setq ok 3));end if
  34.   (setq count_g 0);&#947;&#955;&#958;&#945;&#944;&#955;&#972;&#957;&#971;&#953; &#961;&#967;&#949;&#962;&#967;&#952;&#954;
  35.    (repeat (SSLENGTH ss_nab); &#934;&#920;&#922;&#923;
  36.     (setq sp_vrtx(get-pline-list-vertext(ssname ss_nab N)))
  37.    (setq count 0)
  38.   (repeat(LENGTH sp_vrtx);&#966;&#952;&#954;&#955; &#959;&#958; &#962;&#958;&#967;&#954;&#944;&#956;
  39.           (setq pt_p (nth count sp_vrtx))
  40.    ; (setq x(distof(rtos(nth 1 pt_p)2 3)1))
  41. ;(setq y(distof(rtos(nth 0 pt_p)2 3)1))
  42.      
  43.           (setq x(to_gsi (nth 1 pt_p)))
  44.           (setq y(to_gsi (nth 0 pt_p)))
  45.    
  46.    ;(command "_point" pt_p "")
  47.    (entmake(list'(0 . "POINT")(cons 10 pt_p)'(8 . "&#946;&#971;&#957;&#958;&#961;")));end entmake
  48.    
  49.      ; (command "_TEXT" pt_p 0.5 "0" (strcat pref(itoa N) "-" (itoa(+ count 1))))
  50. ;;;    (command "_TEXT" pt_p 0.5 "0" (strcat pref "." (itoa(+ count_g 1))))
  51.     (setq txt(strcat pref "." (itoa(+ count_g 1))))
  52.     (list
  53.       (cons 0 "TEXT")
  54.       (cons 8 "&#946;&#971;&#957;&#958;&#961;")
  55.       (cons 10 pt_p)
  56.       (cons 11 pt_p)
  57.       (cons 40 0.5)
  58.       (cons 1 txt)
  59.       (cons 50 0)
  60.       (cons 7 "Standard")
  61.       (cons 71 0)
  62.       (cons 72 1)
  63.       (cons 73 0)
  64.     ))
  65.    
  66.   ; (setq x(nth 1 pt_p))
  67.   ; (setq y(nth 0 pt_p))
  68.  
  69.     ;&#951;&#944;&#959;&#952;&#961;&#972; &#946; &#964;&#944;&#953;&#955;
  70.     (setq num(strcat pref "." (itoa(+ count_g 1))))
  71.       (repeat (- 16(strlen num));&#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#949; &#957;&#963;&#955;&#949;&#953;
  72.     (setq num(strcat "0" num))
  73.     );&#954;&#958;&#957;&#949;&#966; &#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#63739; &#957;&#963;&#955;&#949;&#953;
  74.    
  75.       (princ
  76.         (strcat "*" (rtos (+ 110000 count_g 1) 2 0) "+" num)
  77.         fl)
  78.     (write-char 32 fl)(princ (strcat "81..10" y) fl)(write-char 32 fl)(princ (strcat "82..10" x) fl)(write-char 32 fl)(princ "83..10+0000000000000001" fl)(write-char 32 fl)(write-char 10 fl)
  79.          ; (setq num (+ num 1));&#952;&#957;&#954;&#960;&#949;&#956;&#949;&#957;&#962; &#959;&#952;&#954;&#949;&#962;&#958;&#946;
  80.           (setq count (+ count 1)); &#952;&#957;&#954;&#960;&#949;&#956;&#949;&#957;&#962; &#962;&#958;&#967;&#949;&#954;
  81.     (setq count_g (+ count_g 1)); &#947;&#955;&#958;&#945;&#944;&#955;&#972;&#957;&#971;&#953; &#952;&#957;&#954;&#960;&#949;&#956;&#949;&#957;&#962; &#962;&#958;&#967;&#949;&#954;
  82.                   );&#954;&#958;&#957;&#949;&#966; &#966;&#952;&#954;&#955;&#944; &#959;&#958; &#962;&#958;&#967;&#954;&#944;&#956;
  83.  ;(write-char 10 fl)
  84.   ;(prin1(strcat"&#927;&#949;&#960;&#952;&#956;&#949;&#962;&#960;: "(rtos (getvar "perimeter")2 0) " &#956;.") fl)(write-char 10 fl)
  85.   ;(prin1(strcat"&#916;&#958;&#959;. &#959;&#958;&#947;&#960;&#949;&#968;&#957;&#958;&#961;&#962;&#972;: "(rtos(*(sqrt(getvar "AREA"))(* 3.5 fdop))2 0) " &#954;&#946;.&#956;.") fl)(write-char 10 fl)
  86.      
  87.      
  88.      (SETQ N (+ N 1))
  89.      ); &#922;&#926;&#925;&#917;&#934; &#934;&#920;&#922;&#923;&#912;
  90.   ))
  91.    (close fl)
  92.   (setvar "cmdecho" 0)
  93.   (alert (strcat "&#941;&#954;&#961;&#959;&#958;&#960;&#962; &#946; &#964;&#944;&#953;&#955; " fl_name  " &#951;&#944;&#946;&#949;&#960;&#968;&#949;&#957;"))
  94.  
  95.   );end defun
  96.  
  97.  
  98. ;;; &#932;&#963;&#957;&#954;&#966;&#952;&#63739; &#946;&#958;&#951;&#946;&#960;&#944;&#969;&#944;&#949;&#962; &#962;&#949;&#954;&#961;&#962; &#967;&#952;&#961;&#955;&#944; &#946; &#964;&#958;&#960;&#956;&#944;&#962;&#949; GSI16
  99.  
  100. (defun to_gsi (num / text)
  101.  (if (>= num 0);&#967;&#952;&#961;&#955;&#958; &#959;&#958;&#955;&#958;&#950;&#952;&#962;&#949;&#955;&#972;&#957;&#958;&#949;
  102.   (progn
  103.   (setq text (rtos(* num 1000)2 0))
  104.   (repeat (- 16(strlen text));&#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#949; &#957;&#963;&#955;&#949;&#953;
  105.     (setq text(strcat "0" text))
  106.     );&#954;&#958;&#957;&#949;&#966; &#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#63739; &#957;&#963;&#955;&#949;&#953;
  107.   (setq text(strcat "0+" text))
  108.   ));&#954;&#958;&#957;&#949;&#966; &#963;&#961;&#955;&#958;&#946;&#952;&#63739; &#959;&#958;&#955;&#958;&#950;&#952;&#962;&#949;&#955;&#972;&#957;&#958;&#947;&#958; &#967;&#952;&#961;&#955;&#944;
  109.  
  110.   (if (< num 0);&#967;&#952;&#961;&#955;&#958; &#958;&#962;&#960;&#952;&#966;&#944;&#962;&#949;&#955;&#972;&#957;&#958;&#949;
  111.     (progn
  112.   (setq text (rtos(* num -1000)2 0))
  113.   (repeat (- 16(strlen text));&#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#949; &#957;&#963;&#955;&#949;&#953;
  114.     (setq text(strcat "0" text))
  115.     );&#954;&#958;&#957;&#949;&#966; &#948;&#958;&#945;&#944;&#946;&#955;&#949;&#957;&#952;&#63739; &#957;&#963;&#955;&#949;&#953;
  116.   (setq text(strcat "0-" text))
  117.   ));&#954;&#958;&#957;&#949;&#966; &#963;&#961;&#955;&#958;&#946;&#952;&#63739; &#958;&#962;&#960;&#952;&#966;&#944;&#962;&#949;&#955;&#972;&#957;&#958;&#947;&#958; &#967;&#952;&#961;&#955;&#944;
  118.   text
  119.   );end defun
  120.  
  121.  
  122.    
  123.  
  124.  
  125.   ;;; &#932;&#963;&#957;&#954;&#966;&#952;&#63739; &#946;&#958;&#951;&#946;&#960;&#944;&#969;&#944;&#949;&#962; &#961;&#959;&#952;&#961;&#958;&#954; &#962;&#958;&#967;&#949;&#954; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#952; (&#958;&#945;&#955;&#949;&#947;&#967;&#949;&#957;&#957;&#958;&#953; &#955;&#952;&#945;&#958; &#961;&#962;&#944;&#957;&#948;&#944;&#960;&#962;&#957;&#958;&#953;)
  126. ;;; &#914; &#954;&#944;&#967;&#949;&#961;&#962;&#946;&#949; &#959;&#944;&#960;&#944;&#956;&#949;&#962;&#960;&#944; &#964;&#963;&#957;&#954;&#966;&#952;&#952; &#959;&#949;&#960;&#949;&#948;&#944;&#949;&#962;&#961;&#63739; &#952;&#956;&#63739; &#959;&#960;&#952;&#956;&#952;&#962;&#952;&#946;&#944;, &#946;&#958;&#951;&#946;&#960;&#944;&#969;&#944;&#949;&#962;&#961;&#63739; &#961;&#959;&#952;&#961;&#958;&#954; &#952;&#951;
  127. ;;; &#948;&#946;&#963;&#965;&#956;&#949;&#960;&#957;&#971;&#965; (&#948;&#955;&#63739; &#958;&#945;&#955;&#949;&#947;&#967;&#949;&#957;&#957;&#958;&#953; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#952;) &#952;&#955;&#952; &#962;&#960;&#949;&#965;&#956;&#949;&#960;&#957;&#971;&#965; (&#948;&#955;&#63739; &#961;&#962;&#944;&#957;&#948;&#944;&#960;&#962;&#957;&#958;&#953;) &#946; &#962;&#958;&#956; &#959;&#958;&#960;&#63739;&#948;&#954;&#949;,
  128. ;;; &#946; &#954;&#958;&#962;&#958;&#960;&#958;&#956; &#958;&#957;&#952; &#961;&#958;&#948;&#949;&#960;&#950;&#944;&#962;&#961;&#63739; &#946; &#958;&#959;&#952;&#961;&#944;&#957;&#952;&#952; &#959;&#960;&#952;&#956;&#952;&#962;&#952;&#946;&#944;-&#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#952;
  129. ;;; &#952;&#955;&#952; nil, &#949;&#961;&#955;&#952; &#959;&#960;&#952;&#956;&#952;&#962;&#952;&#946; &#957;&#949; &#63739;&#946;&#955;&#63739;&#949;&#962;&#961;&#63739; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#949;&#953;
  130.  
  131. (defun get-pline-list-vertext (polylineName / polylineInfo vertexName listOfPoints)
  132. ;; &#926;&#945;&#955;&#949;&#947;&#967;&#949;&#957;&#957;&#944;&#63739; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#63739;
  133. ((= (cdr (assoc '0 (entget polylineName))) "LWPOLYLINE")
  134. (setq polylineInfo (entget polylineName))
  135. (while (vl-position (assoc '10 polylineInfo) polylineInfo)
  136. (setq listOfPoints
  137. (assoc '10 polylineInfo)
  138. polylineInfo
  139. ) ;_ vl-position
  140. polylineInfo
  141. ) ;_ nth
  142. ) ;_ cdr
  143. listOfPoints
  144. ) ;_ cons
  145. ) ;_ setq
  146. (setq polylineInfo
  147. (vl-remove (assoc '10 polylineInfo) polylineInfo)
  148. ) ;_ setq
  149. ) ;_ while
  150. )
  151. ;; &#929;&#962;&#944;&#957;&#948;&#944;&#960;&#962;&#957;&#944;&#63739; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#63739;
  152. ((= (cdr (assoc '0 (entget polylineName))) "POLYLINE")
  153. (setq vertexName (entnext polylineName))
  154. (while vertexName
  155. (if (= (cdr (assoc '0 (entget vertexName))) "VERTEX")
  156. (setq listOfPoints
  157. (assoc '10 (entget vertexName))
  158. ) ;_ cdr
  159. listOfPoints
  160. ) ;_ cons
  161. ) ;_ setq
  162. ) ;_ if
  163. (setq vertexName (entnext vertexName))
  164. ) ;_ while
  165. )
  166. ;; &#925;&#949; &#63739;&#946;&#955;&#63739;&#949;&#962;&#961;&#63739; &#959;&#958;&#955;&#952;&#955;&#952;&#957;&#952;&#949;&#953;
  167. (T
  168. (setq listOfPoints nil)
  169. )
  170. ) ;_ cond
  171. (reverse listOfPoints)
  172. ) ;_ defun
  173.  
  174.  

Thanks

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #4 on: April 13, 2019, 12:56:00 AM »
Why try to make a GSI can you not just create a csv file getting the co-ords of a pline and numbering them is not a problem. It could have description=layer.
A man who never made a mistake never made anything

pedroantonio

  • Guest
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #5 on: April 13, 2019, 02:40:36 AM »
I want a gsi16 file because i want to upload it to my tolal station  to steak out points. Leica Geo office tools have problems with the windows 10 is not working properly.

pedroantonio

  • Guest
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #6 on: April 13, 2019, 12:16:11 PM »
Please this is important post of can on help ?

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #7 on: April 14, 2019, 01:59:10 AM »
My ex work had 2 leica's and they uploaded a csv file all the time. I am an ex survey instrument employee and I have never heard of a reasonably aged instrument that could not load a csv file.

Have you spoke to your leica dealer about this ?

I just googled and there was lots of links with leica manuals.
« Last Edit: April 14, 2019, 02:04:09 AM by BIGAL »
A man who never made a mistake never made anything

pedroantonio

  • Guest
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #8 on: April 14, 2019, 04:39:14 AM »
i can upload only *.gsi and *.idx files

the  *idx file is like this

Code: [Select]
HEADER
  VERSION      1.31
  SYSTEM       "Leica SurveyOffice: Coordinate Editor 1.0"
  SEPARATOR    ','
  TERMINATOR   ';'
  UNITS
    LINEAR     METRE
  END UNITS
  PROJECT
    NAME           "XARA"
    CREATION_DATE  16-11-2009/15:10:51.0
  END PROJECT
END HEADER


DATABASE
  POINTS (PointNo,PointID,Code,East,North,Elevation,CLASS)
     1,  "1",   "",  304349.393,  4231409.416,  ,  FIX;
     2,  "2",   "",  304393.029,  4231402.861,  ,  FIX;
     3,  "3",   "",  304415.145,  4231399.457,  ,  FIX;
     4,  "4",   "",  304432.001,  4231396.890,  ,  FIX;
     5,  "5",   "",  304451.803,  4231397.018,  ,  FIX;
     6,  "6",   "",  304466.943,  4231397.622,  ,  FIX;
     7,  "7",   "",  304476.326,  4231397.950,  ,  FIX;
     8,  "8",   "",  304484.483,  4231396.444,  ,  FIX;
     9,  "9",   "",  304492.448,  4231393.357,  ,  FIX;
    10,  "10",  "",  304507.368,  4231389.199,  ,  FIX;
    11,  "11",  "",  304507.226,  4231387.224,  ,  FIX;
    12,  "12",  "",  304390.353,  4231382.153,  ,  FIX;
    13,  "13",  "",  304389.209,  4231373.298,  ,  FIX;
    14,  "14",  "",  304386.234,  4231373.682,  ,  FIX;
    15,  "15",  "",  304353.854,  4231378.570,  ,  FIX;
    16,  "16",  "",  304351.623,  4231393.993,  ,  FIX;
    17,  "17",  "",  304391.316,  4231389.617,  ,  FIX;
    18,  "18",  "",  304416.071,  4231390.577,  ,  FIX;
    19,  "19",  "",  304432.262,  4231390.896,  ,  FIX;
    20,  "20",  "",  304452.063,  4231391.023,  ,  FIX;
    21,  "S1",  "",  304380.031,  4231368.168,  ,  FIX;
    22,  "S2",  "",  304386.326,  4231388.204,  ,  FIX;
    23,  "S3",  "",  304356.539,  4231382.693,  ,  FIX;
    THEMINFO (PointNo,PointID,Attribute,Value)
       1,  "1",   "Info 1",  "";
       1,  "1",   "Info 2",  "";
       1,  "1",   "Info 3",  "";
       1,  "1",   "Info 4",  "";
       1,  "1",   "Info 5",  "";
       1,  "1",   "Info 6",  "";
       1,  "1",   "Info 7",  "";
       1,  "1",   "Info 8",  "";
       2,  "2",   "Info 1",  "";
       2,  "2",   "Info 2",  "";
       2,  "2",   "Info 3",  "";
       2,  "2",   "Info 4",  "";
       2,  "2",   "Info 5",  "";
       2,  "2",   "Info 6",  "";
       2,  "2",   "Info 7",  "";
       2,  "2",   "Info 8",  "";
       3,  "3",   "Info 1",  "";
       3,  "3",   "Info 2",  "";
       3,  "3",   "Info 3",  "";
       3,  "3",   "Info 4",  "";
       3,  "3",   "Info 5",  "";
       3,  "3",   "Info 6",  "";
       3,  "3",   "Info 7",  "";
       3,  "3",   "Info 8",  "";
       4,  "4",   "Info 1",  "";
       4,  "4",   "Info 2",  "";
       4,  "4",   "Info 3",  "";
       4,  "4",   "Info 4",  "";
       4,  "4",   "Info 5",  "";
       4,  "4",   "Info 6",  "";
       4,  "4",   "Info 7",  "";
       4,  "4",   "Info 8",  "";
       5,  "5",   "Info 1",  "";
       5,  "5",   "Info 2",  "";
       5,  "5",   "Info 3",  "";
       5,  "5",   "Info 4",  "";
       5,  "5",   "Info 5",  "";
       5,  "5",   "Info 6",  "";
       5,  "5",   "Info 7",  "";
       5,  "5",   "Info 8",  "";
       6,  "6",   "Info 1",  "";
       6,  "6",   "Info 2",  "";
       6,  "6",   "Info 3",  "";
       6,  "6",   "Info 4",  "";
       6,  "6",   "Info 5",  "";
       6,  "6",   "Info 6",  "";
       6,  "6",   "Info 7",  "";
       6,  "6",   "Info 8",  "";
       7,  "7",   "Info 1",  "";
       7,  "7",   "Info 2",  "";
       7,  "7",   "Info 3",  "";
       7,  "7",   "Info 4",  "";
       7,  "7",   "Info 5",  "";
       7,  "7",   "Info 6",  "";
       7,  "7",   "Info 7",  "";
       7,  "7",   "Info 8",  "";
       8,  "8",   "Info 1",  "";
       8,  "8",   "Info 2",  "";
       8,  "8",   "Info 3",  "";
       8,  "8",   "Info 4",  "";
       8,  "8",   "Info 5",  "";
       8,  "8",   "Info 6",  "";
       8,  "8",   "Info 7",  "";
       8,  "8",   "Info 8",  "";
       9,  "9",   "Info 1",  "";
       9,  "9",   "Info 2",  "";
       9,  "9",   "Info 3",  "";
       9,  "9",   "Info 4",  "";
       9,  "9",   "Info 5",  "";
       9,  "9",   "Info 6",  "";
       9,  "9",   "Info 7",  "";
       9,  "9",   "Info 8",  "";
      10,  "10",  "Info 1",  "";
      10,  "10",  "Info 2",  "";
      10,  "10",  "Info 3",  "";
      10,  "10",  "Info 4",  "";
      10,  "10",  "Info 5",  "";
      10,  "10",  "Info 6",  "";
      10,  "10",  "Info 7",  "";
      10,  "10",  "Info 8",  "";
      11,  "11",  "Info 1",  "";
      11,  "11",  "Info 2",  "";
      11,  "11",  "Info 3",  "";
      11,  "11",  "Info 4",  "";
      11,  "11",  "Info 5",  "";
      11,  "11",  "Info 6",  "";
      11,  "11",  "Info 7",  "";
      11,  "11",  "Info 8",  "";
      12,  "12",  "Info 1",  "";
      12,  "12",  "Info 2",  "";
      12,  "12",  "Info 3",  "";
      12,  "12",  "Info 4",  "";
      12,  "12",  "Info 5",  "";
      12,  "12",  "Info 6",  "";
      12,  "12",  "Info 7",  "";
      12,  "12",  "Info 8",  "";
      13,  "13",  "Info 1",  "";
      13,  "13",  "Info 2",  "";
      13,  "13",  "Info 3",  "";
      13,  "13",  "Info 4",  "";
      13,  "13",  "Info 5",  "";
      13,  "13",  "Info 6",  "";
      13,  "13",  "Info 7",  "";
      13,  "13",  "Info 8",  "";
      14,  "14",  "Info 1",  "";
      14,  "14",  "Info 2",  "";
      14,  "14",  "Info 3",  "";
      14,  "14",  "Info 4",  "";
      14,  "14",  "Info 5",  "";
      14,  "14",  "Info 6",  "";
      14,  "14",  "Info 7",  "";
      14,  "14",  "Info 8",  "";
      15,  "15",  "Info 1",  "";
      15,  "15",  "Info 2",  "";
      15,  "15",  "Info 3",  "";
      15,  "15",  "Info 4",  "";
      15,  "15",  "Info 5",  "";
      15,  "15",  "Info 6",  "";
      15,  "15",  "Info 7",  "";
      15,  "15",  "Info 8",  "";
      16,  "16",  "Info 1",  "";
      16,  "16",  "Info 2",  "";
      16,  "16",  "Info 3",  "";
      16,  "16",  "Info 4",  "";
      16,  "16",  "Info 5",  "";
      16,  "16",  "Info 6",  "";
      16,  "16",  "Info 7",  "";
      16,  "16",  "Info 8",  "";
      17,  "17",  "Info 1",  "";
      17,  "17",  "Info 2",  "";
      17,  "17",  "Info 3",  "";
      17,  "17",  "Info 4",  "";
      17,  "17",  "Info 5",  "";
      17,  "17",  "Info 6",  "";
      17,  "17",  "Info 7",  "";
      17,  "17",  "Info 8",  "";
      18,  "18",  "Info 1",  "";
      18,  "18",  "Info 2",  "";
      18,  "18",  "Info 3",  "";
      18,  "18",  "Info 4",  "";
      18,  "18",  "Info 5",  "";
      18,  "18",  "Info 6",  "";
      18,  "18",  "Info 7",  "";
      18,  "18",  "Info 8",  "";
      19,  "19",  "Info 1",  "";
      19,  "19",  "Info 2",  "";
      19,  "19",  "Info 3",  "";
      19,  "19",  "Info 4",  "";
      19,  "19",  "Info 5",  "";
      19,  "19",  "Info 6",  "";
      19,  "19",  "Info 7",  "";
      19,  "19",  "Info 8",  "";
      20,  "20",  "Info 1",  "";
      20,  "20",  "Info 2",  "";
      20,  "20",  "Info 3",  "";
      20,  "20",  "Info 4",  "";
      20,  "20",  "Info 5",  "";
      20,  "20",  "Info 6",  "";
      20,  "20",  "Info 7",  "";
      20,  "20",  "Info 8",  "";
      21,  "S1",  "Info 1",  "";
      21,  "S1",  "Info 2",  "";
      21,  "S1",  "Info 3",  "";
      21,  "S1",  "Info 4",  "";
      21,  "S1",  "Info 5",  "";
      21,  "S1",  "Info 6",  "";
      21,  "S1",  "Info 7",  "";
      21,  "S1",  "Info 8",  "";
      22,  "S2",  "Info 1",  "";
      22,  "S2",  "Info 2",  "";
      22,  "S2",  "Info 3",  "";
      22,  "S2",  "Info 4",  "";
      22,  "S2",  "Info 5",  "";
      22,  "S2",  "Info 6",  "";
      22,  "S2",  "Info 7",  "";
      22,  "S2",  "Info 8",  "";
      23,  "S3",  "Info 1",  "";
      23,  "S3",  "Info 2",  "";
      23,  "S3",  "Info 3",  "";
      23,  "S3",  "Info 4",  "";
      23,  "S3",  "Info 5",  "";
      23,  "S3",  "Info 6",  "";
      23,  "S3",  "Info 7",  "";
      23,  "S3",  "Info 8",  "";
    END THEMINFO
  END POINTS
END DATABASE




I am searching for a lisp code to convert a *txt file with P,X,Y,Z to *.idx. I need this files please help

Thanks
« Last Edit: April 14, 2019, 04:42:34 AM by Topographer »

pedroantonio

  • Guest
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #9 on: April 14, 2019, 11:39:52 AM »
Any ideas?

pedroantonio

  • Guest
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #10 on: April 15, 2019, 02:27:16 AM »
Hi  BIGAL i don't know if you ever upload data to leica  total station but is not possiple in any model to insert csn file. All the times we use gsi files or idx. You only can download coordinates in gsi,dxf,txt,csv but never upload  csv

pedroantonio

  • Guest
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #11 on: April 15, 2019, 10:03:35 AM »
I need help

Code - Auto/Visual Lisp: [Select]
  1. (defun c:test ( / num count_g count sp_vrtx ss_nab fl_name ff fl ok pref N x y z txt)
  2.  
  3.  (setq file (getfiled "Open CSV File" "" "csv" 16))
  4.        
  5.  (setq fl_name (getfiled "Save GSI as" (getvar "DWGPREFIX") "gsi" 1))
  6.  
  7.  
  8.    
  9.       (princ
  10.         (strcat "*" (rtos (+ 110000 count_g 1) 2 0) "+" num)
  11.         fl)
  12.  
  13.     (write-char 32 fl)(princ (strcat "81..10" x) fl)(write-char 32 fl)(princ (strcat "82..10" y) fl)(write-char 32 fl)(princ "83..10" z) fl)
  14.           (setq count (+ count 1))
  15.     (setq count_g (+ count_g 1))    
  16.      
  17.      (SETQ N (+ N 1))
  18.         (close fl)
  19.   (setvar "cmdecho" 0)
  20.  
  21.   );end defun
  22.  

Thanks
« Last Edit: April 15, 2019, 10:15:34 AM by Topographer »

pedroantonio

  • Guest
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #12 on: April 15, 2019, 07:15:04 PM »
no one ?

CostinBos77

  • Mosquito
  • Posts: 19
  • Land surveyor in action !
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #13 on: April 20, 2019, 05:09:46 PM »
Hello Topographer !

Do you really need GSI 16 format ? TCR 805 is importing IDX file as well . You can do it with Leica Geo Office .

Do you have it ?

Maybe you will need this : https://www.youtube.com/watch?v=hrRrOedivfA&t=34s ;
or https://www.youtube.com/watch?v=C7lj69VUrkw&t=8s ;
or https://www.youtube.com/watch?v=3L5nRZ1njjQ

From Excel file, you can copy into your Leica Editor .

Costin
« Last Edit: April 20, 2019, 05:18:11 PM by CostinBos77 »
Land surveyor in action !!!

:yes:

pedroantonio

  • Guest
Re: Help with lisp : Convert *.txt file to leica *.gsi16
« Reply #14 on: April 20, 2019, 05:11:53 PM »
Thank you.I solved the problem