Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing Drawing number in multiple sheets

3 REPLIES 3
Reply
Message 1 of 4
pillaisg
274 Views, 3 Replies

Changing Drawing number in multiple sheets

I am having some 500 sheets in which I have to change the Drawing Numbers. The format of the drawing Number is as follows SGP-5-1000-001-R2-A1-0. In which SGP is the area code,5 is the discipline code, 1000 is the drawing number,R2 is the project code A1 is the sheet size and 0 is the revision.
I need to change the area code (SGP) and Drawing NUmber (1000) in all the 500 sheets. This drawing number is in an attribute format.
Thanks in advance
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: pillaisg

Hi pillaisg,
test this code but sorry I'm not can help you
[code]
(defun c:test (/ all_file_name cnt code f1 f2 f3 f4
file_folder len nfile num ofile str x y)
(vl-load-com)
(setq file_folder "D:/YBI") ; set as your folder !!!
(setq all_file_name (cddr (vl-directory-files file_folder)))
(setq len (length all_file_name))
(setq cnt 0)
(setq code (getstring "\nEnter new area code: "))
(if (= code "")(setq code "SGP"))
(setq x (strcat "100*"))
(setq num (getint "\nEnter start number<1>: "))
(if (= num nil)(setq num 1))
(repeat
len
(setq y (nth cnt all_file_name))
(if
(wcmatch y x)
(progn
(setq f1 (substr y 1 5))
(setq f3 (substr y 9 3))
(setq f4 (substr y 16 16))
(setq str (strcat f1 code f3 (itoa num) f4))
(setq nfile (strcat file_folder "/" str))
(setq ofile (strcat file_folder "/" y))
(vl-file-rename ofile nfile)
) ; progn
) ; if
(setq cnt (1+ cnt))
) ; repeat
(princ)
) ; defun
[/code]

wrote in message news:5800074@discussion.autodesk.com...
I am having some 500 sheets in which I have to change the Drawing Numbers.
The format of the drawing Number is as follows SGP-5-1000-001-R2-A1-0. In
which SGP is the area code,5 is the discipline code, 1000 is the drawing
number,R2 is the project code A1 is the sheet size and 0 is the revision.
I need to change the area code (SGP) and Drawing NUmber (1000) in all the
500 sheets. This drawing number is in an attribute format.
Thanks in advance
Message 3 of 4
Anonymous
in reply to: pillaisg

We using field and diesel expression at the drawing number text which refer
to the filename of drawing.

I know some free batch filename rename software can rename portion of
filename.

After you rename the filename, the drawing number will follow your filename
of drawing.

--
Regards,

Ken Luk


wrote in message news:5800074@discussion.autodesk.com...
I am having some 500 sheets in which I have to change the Drawing Numbers.
The format of the drawing Number is as follows SGP-5-1000-001-R2-A1-0. In
which SGP is the area code,5 is the discipline code, 1000 is the drawing
number,R2 is the project code A1 is the sheet size and 0 is the revision.
I need to change the area code (SGP) and Drawing NUmber (1000) in all the
500 sheets. This drawing number is in an attribute format.
Thanks in advance
Message 4 of 4
EC-CAD
in reply to: pillaisg

See your previous post(s).
I placed code there that will do what you need.

Bob

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost