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

Publish Code - Extract icon .BMP files from menu .MNR file

1 REPLY 1
Reply
Message 1 of 2
Anonymous
310 Views, 1 Reply

Publish Code - Extract icon .BMP files from menu .MNR file

;;; ;;; BMP from MNR, extract bitmap utility. ;;; by Matthew S Rothgery, 3-18-2004 ;;; ;;; Saves individual .BMP files read from the ;;; current menu's .MNR file, in the same directory. ;;; (defun c:BMPfromMNR(/ *error* fileMNR fileBMP ct offset byte) (defun *error*(s) (if fileBMP(setq fileBMP(close fileBMP))) (if fileMNR(setq fileMNR(close fileMNR))) (princ) ) (setq fileMNR (open(findfile(strcat(getvar"MENUNAME")".MNR"))"r") ct 1 offset 0 byte '(0 0) ) (while(setq char(read-char fileMNR)) (cond((equal byte '(66 77)) (setq fileBMP(strcat(getvar"MENUNAME")"_BMP_EXTRACT"(itoa ct)".BMP")) (prompt(strcat "\n\nCreating file:\n" fileBMP "\n")) (setq ct (1+ ct) fileBMP (open fileBMP "w") byte (list char) offset 6 ) (while(<(length byte)4) (setq byte(append byte(list(read-char fileMNR)))) ) (write-char 66 fileBMP) (write-char 77 fileBMP) (foreach c byte(write-char(+ 256 c)fileBMP)) (setq byte(apply'+(mapcar'* byte'(1 256 65536 16777216)))) ) ((not fileBMP)(setq byte(list(cadr byte)char))) ((not(numberp byte))) ((< offset byte) (write-char(+ 256 char)fileBMP) (setq offset(1+ offset)) (prompt(strcat"\r"(itoa offset))) ) ((= offset byte) (write-char 256 fileBMP) (setq fileBMP(close fileBMP)) (setq byte(list 0 char)offset(1+ offset)) (prompt(strcat"\r"(itoa offset)" bytes")) ) ) ) (*error*()) )
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

thx! "mataeux" wrote in message news:405b6f03_2@newsprd01... > ;;; > ;;; BMP from MNR, extract bitmap utility. > ;;; by Matthew S Rothgery, 3-18-2004 > ;;; > ;;; Saves individual .BMP files read from the > ;;; current menu's .MNR file, in the same directory. > ;;; > (defun c:BMPfromMNR(/ *error* fileMNR fileBMP ct offset byte) > (defun *error*(s) > (if fileBMP(setq fileBMP(close fileBMP))) > (if fileMNR(setq fileMNR(close fileMNR))) > (princ) > ) > (setq fileMNR (open(findfile(strcat(getvar"MENUNAME")".MNR"))"r") > ct 1 > offset 0 > byte '(0 0) > ) > (while(setq char(read-char fileMNR)) > (cond((equal byte '(66 77)) > (setq fileBMP(strcat(getvar"MENUNAME")"_BMP_EXTRACT"(itoa > ct)".BMP")) > (prompt(strcat "\n\nCreating file:\n" fileBMP "\n")) > (setq ct (1+ ct) > fileBMP (open fileBMP "w") > byte (list char) > offset 6 > ) > (while(<(length byte)4) > (setq byte(append byte(list(read-char fileMNR)))) > ) > (write-char 66 fileBMP) > (write-char 77 fileBMP) > (foreach c byte(write-char(+ 256 c)fileBMP)) > (setq byte(apply'+(mapcar'* byte'(1 256 65536 16777216)))) > ) > ((not fileBMP)(setq byte(list(cadr byte)char))) > ((not(numberp byte))) > ((< offset byte) > (write-char(+ 256 char)fileBMP) > (setq offset(1+ offset)) > (prompt(strcat"\r"(itoa offset))) > ) > ((= offset byte) > (write-char 256 fileBMP) > (setq fileBMP(close fileBMP)) > (setq byte(list 0 char)offset(1+ offset)) > (prompt(strcat"\r"(itoa offset)" bytes")) > ) > ) > ) > (*error*()) > ) > > >

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

Post to forums  

Autodesk Design & Make Report

”Boost