0 Members and 1 Guest are viewing this topic.
Hello again!You have to do 3 things before you run routine 1) Install OpenDCL runtime from www.opendcl.com2) In file laylist.txt can youself define your Standard layer which you want move to3) put in searchpath in your support-tab on optionfield there odcl is, so Autocad can find odcl-filerun with "laytool"Code: [Select]; <<< Help Utilities >>>(defun getLayer (/ laynam lay laylist) (setq laynam (tblnext "layer" T)) (while laynam (setq lay (cdr (assoc 2 laynam))) (setq laylist (vl-sort (append laylist (list lay)) '<)) (setq laynam (tblnext "layer")) ) laylist )(defun standard ( / file OpenFile Line Content) (if (setq file (findfile "c:\\Your searchpath there Laylist is\\LayerList.txt")) (progn (setq OpenFile (open file "r")) (while (setq Line (read-line OpenFile)) (if (not (wcmatch line "")) (setq Content (append Content (list line))) ) ) (close OpenFile) ) ) Content ); <<< OpenDCL Event Handlers >>>(defun c:LayTool () (command "OPENDCL") (dcl_Project_Load "LayerTool" T) (dcl_Form_Show LayerTool_PalLayer) (princ) ) (defun c:LayerTool_PalLayer_OnInitialize (/) (dcl_ListBox_Clear LayerTool_PalLayer_ListboxLayer) (DCL_LISTBOX_ADDLIST LayerTool_PalLayer_ListboxLayer (getLayer)) (DCL_LISTBOX_ADDLIST LayerTool_PalLayer_ListboxLayerStandard (standard)) )(defun c:LayerTool_PalLayer_ListBoxLayer_OnSelChanged (ssL txt /) (setq sS "") (if (setq iL (dcl_ListBox_GetCurSel LayerTool_PalLayer_ListboxLayer)) (setq sL (dcl_ListBox_GetItemText LayerTool_PalLayer_ListBoxLayer iL)) ) (if (setq iS (dcl_ListBox_GetCurSel LayerTool_PalLayer_ListBoxLayerStandard)) (setq sS (dcl_ListBox_GetItemText LayerTool_PalLayer_ListBoxLayerStandard iS)) ) (setvar "CLAYER" sL) (command "layer" "off" "*" "y" "") (princ) (command "layer" "on" sL "" ) (princ) (princ (strcat sL " ")) (princ (strcat "-> " sS)) (princ) )(defun c:LayerTool_PalLayer_cmdMove_OnClicked (/) (if (setq AWS (ssget "X" (list (cons 8 sL)))) (progn (setq I -1) (repeat (sslength AWS) (setq OBJ (ssname AWS(setq I (1+ I)))) (setq DATA(entget OBJ)) (entmod (subst (cons 8 sS) (assoc 8 (entget OBJ)) (entget OBJ) ) ) ) ) ) (princ "\nok") (princ) )(defun c:LayerTool_PalLayer_cmdLayerOn_OnClicked (/) (command "layer" "on" "*" "" ) (princ) )Thanks to Owen and irned, you give me very good ideasRecall me if you have trouble to install.Otherwis have fun!Dirk
; <<< Help Utilities >>>(defun getLayer (/ laynam lay laylist) (setq laynam (tblnext "layer" T)) (while laynam (setq lay (cdr (assoc 2 laynam))) (setq laylist (vl-sort (append laylist (list lay)) '<)) (setq laynam (tblnext "layer")) ) laylist )(defun standard ( / file OpenFile Line Content) (if (setq file (findfile "c:\\Your searchpath there Laylist is\\LayerList.txt")) (progn (setq OpenFile (open file "r")) (while (setq Line (read-line OpenFile)) (if (not (wcmatch line "")) (setq Content (append Content (list line))) ) ) (close OpenFile) ) ) Content ); <<< OpenDCL Event Handlers >>>(defun c:LayTool () (command "OPENDCL") (dcl_Project_Load "LayerTool" T) (dcl_Form_Show LayerTool_PalLayer) (princ) ) (defun c:LayerTool_PalLayer_OnInitialize (/) (dcl_ListBox_Clear LayerTool_PalLayer_ListboxLayer) (DCL_LISTBOX_ADDLIST LayerTool_PalLayer_ListboxLayer (getLayer)) (DCL_LISTBOX_ADDLIST LayerTool_PalLayer_ListboxLayerStandard (standard)) )(defun c:LayerTool_PalLayer_ListBoxLayer_OnSelChanged (ssL txt /) (setq sS "") (if (setq iL (dcl_ListBox_GetCurSel LayerTool_PalLayer_ListboxLayer)) (setq sL (dcl_ListBox_GetItemText LayerTool_PalLayer_ListBoxLayer iL)) ) (if (setq iS (dcl_ListBox_GetCurSel LayerTool_PalLayer_ListBoxLayerStandard)) (setq sS (dcl_ListBox_GetItemText LayerTool_PalLayer_ListBoxLayerStandard iS)) ) (setvar "CLAYER" sL) (command "layer" "off" "*" "y" "") (princ) (command "layer" "on" sL "" ) (princ) (princ (strcat sL " ")) (princ (strcat "-> " sS)) (princ) )(defun c:LayerTool_PalLayer_cmdMove_OnClicked (/) (if (setq AWS (ssget "X" (list (cons 8 sL)))) (progn (setq I -1) (repeat (sslength AWS) (setq OBJ (ssname AWS(setq I (1+ I)))) (setq DATA(entget OBJ)) (entmod (subst (cons 8 sS) (assoc 8 (entget OBJ)) (entget OBJ) ) ) ) ) ) (princ "\nok") (princ) )(defun c:LayerTool_PalLayer_cmdLayerOn_OnClicked (/) (command "layer" "on" "*" "" ) (princ) )
Here I have change size of palettes...
Yes I have seen listbox could be smaller so it also seems move button, you can change very comfortably with OpenDCL editor...