View Full Version : request: code to change text in the file
guest
25th Jun 2005, 09:12 am
Hi,
I need a lisp code to do the following:
I have dwg file. And in original file there is a text let's say "XX". I want to make copies of this file such that the text "XX" is changed to "XX001" in the first copy, "XX002" in the second copy,.....,"XX100" in the 100th copy.
I would be grateful if someone could post a lisp code to achieve this.
Adesu
7th Jul 2005, 02:45 am
Hi,
I need a lisp code to do the following:
I have dwg file. And in original file there is a text let's say "XX". I want to make copies of this file such that the text "XX" is changed to "XX001" in the first copy, "XX002" in the second copy,.....,"XX100" in the 100th copy.
I would be grateful if someone could post a lisp code to achieve this.
Hi guest,maybe my script useful for, here this code
; cf is stand for create copy file at same folder
; Design by Ade Suharna <mteybid@yuasabattery.co.id>
; 6 July 2005
; Programe no.245/07/2005
; Edit by
(defun c:cf (/ dn str_len num ext_dn dwg cnt n new_dn loc_file new_lf)
(setq dn (getvar "dwgname"))
(setq str_len (strlen dn))
(setq num (- str_len 4))
(setq ext_dn (substr dn 1 num))
(setq dwg ".dwg")
(setq cnt 0)
(setq n (getint "\nHOW MANY COPY DO YOU WANT <100>: "))
(if (= n nil)(setq n 100))
(repeat n
(setq new_dn (strcat ext_dn "-" (itoa cnt) dwg))
(setq loc_file (strcat (getvar "dwgprefix")(getvar "dwgname")))
(setq new_lf (strcat (getvar "dwgprefix") new_dn))
(vl-file-copy loc_file new_lf)
(setq cnt (1+ cnt))
)
)
guest
7th Jul 2005, 07:44 am
Thanks Adesu. This solves part of the problem. But the problem with the text edit still remains. I would appreciate any help on that.
dunkydolittle
19th Nov 2005, 08:04 pm
I would be very interested to hear more on how you overcame your problem. I have a near identical problem, any help much appreciated will try and run the lisp but i am a newcomer to autolisp.
Powered by vBulletin™ Version 4.1.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.