1
308
初来乍到
使用道具 举报
114
1万
中流砥柱
22
326
185
后起之秀
0
11
;;-------------------=={ Color sheme }==------------------------;;;; ;;;; Change the color scheme in AutoCAD (like WinAmp) ;;;; the data of color schemes for AutoCAD stored in xml file ;;;;--------------------------------------------------------------;;;; Author: Vladimir Azarko (VVA), Copyright © 2011 - www.dwg.ru ;;;; Some of updates : Ketxu (Nguyen Son Tung ;;;;--------------------------------------------------------------;;;; Special thanks ;;;; gomer - idea ;;;; Vov.ka - xml parser ;;;; Alexandr Rivilis - GetOleColor, GerRGB ;;;;--------------------------------------------------------------;;;; ALL RIGHTS REMOVED ;;;;--------------------------------------------------------------;;;;--------------------------------------------------------------;;(defun c:ACS()(setq appRegPath "HKEY_CURRENT_USER\\Software\\ACS\")(defun ACS:WK (key)(vl-registry-write (setq rt (strcat appRegPath key))) rt)(defun ACS:WV (path key val)(vl-registry-write (ACS:WK path) key (vl-princ-to-string val))) ;Reg write(defun ACS:W_Shema (x) (ACS:WV (car x) nil (cadr x)))(defun ACS:RV (path key)(read(vl-registry-read (strcat appRegPath path) key))) ;Reg read(defun ACS:Apply_Shema (themes)(mapcar '(lambda(x y) (set_shema (eval x) y)) lstFunc_Put (ACS:RV themes nil)))(defun ACS:Insert_Shema (sName lstColor) ;Insert Shema to Reg(or sName (setq sName (strcat "Themes - " (menucmd (strcat "m=$(edtime," (rtos (getvar "DATE") 2 ",DD:MO:YY - HH:MM:SS)"))))) (ACS:W_Shema(cons sName (list (cond (lstColor) (list ((lambda (display) (mapcar '(lambda (x) (GetRGB (vlax-variant-value (vlax-variant-change-type (eval (list x display)) vlax-vblong ) ;_ end of vlax-variant-change-type ) ;_ end of vlax-variant-value ) ;_ end of GetRGB ) ;_ end of lambda (list 'vla-get-graphicswinmodelbackgrndcolor 'vla-get-modelcrosshaircolor 'vla-get-textwinbackgrndcolor 'vla-get-textwintextcolor 'vla-get-graphicswinlayoutbackgrndcolor 'vla-get-layoutcrosshaircolor) ;_ end of list ) ;_ end of mapcar ) ;_ end of lambda (vla-get-display (vla-get-preferences (vlax-get-acad-object)) ) ;_ end of vla-get-display ) ) ) ))));;; A. Rivilis(defun GetOleColor (r g b) (+ r (lsh g (lsh b 16)))(defun GetRGB (Olecolor) (list (logand Olecolor 255) ;; R (logand (lsh Olecolor - 255) ;; G (logand (lsh Olecolor -16) 255) ;; B ) ;_ end of list) ;_ end of defun(defun set_shema (func lst);;; func - function like 'vla-put-ModelCrosshairColor;;; lst - RGB list (R G B) or (255 0 234) (func (vla-get-display (vla-get-preferences (vlax-get-acad-object)) ) ;_ end of vla-get-display (vlax-make-variant (apply 'GetOleColor lst) vlax-vblong) ) ;_ end of func) ;_ end of defun;VVA : i change sth to learn about action in DCL(defun mydcl (zagl info-list / fl ret dcl_id) (vl-load-com) (or zagl (setq zagl "Select")) (setq fl (vl-filename-mktemp "mip" nil ".dcl")) (setq ret (open fl "w") ud (lambda() (start_list "info" 3) (mapcar 'add_list (setq info-list (acad_strlsort (vl-registry-descendents appRegPath)))) (end_list)) ) (mapcar '(lambda (x) (write-line x ret)) (list "mip_msg : dialog { " (strcat "label="" zagl "";") " :list_box {" "alignment=top ;width=51 ;allow_accept = true;" "tabs = "16 32";tab_truncate = true;" (if (> (length info-list) 26) "height= 26 ;" (strcat "height= " (itoa (+ 3 (length info-list))) ";") ) ;_ end of if "is_tab_stop = false ;" "key = "info";}" " :row {" " :button {" "label=" OK ";" "key = "Accept";" "is_cancel = true;}" " :button {" "label="Apply";" "key = "kApply";}"