Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/18/2018 in all areas

  1. Dont see much speed improvement over having a routine maybe a DCL with buttons over press 1 <Enter> we use menus and tool bars easy to have a tool bar with 1 2 3 4 5 etc. You will need to make the icons here is the tool bar code. Its a MNU file use menuload. It should work without the icons. ***MENUGROUP=NUMBSTOOLBAR ***TOOLBARS **NumberTOOLS ID_ALAN_1 [_Toolbar("Alans2", _LEFT, _Show, 50,50, 1)] 1 [_Button("1","1.bmp,"1.bmp")]^c^c^c(command "1") 2 [_Button("2","2.BMP","2.BMP")]^c^c^c(command "2")
    1 point
  2. My attempt, you need ListboxV1-2.lsp from Lee-mac.com also (defun c:FindIt( / dwglist dwgnum pathnum path dwglist2) (setq path (list "C:\\Users\\miklos.fuccaro\\Documents" "C:\\Acadtemp" "C:\\Users\\Public" ) i -1) ;(repeat (length path) ; (princ (strcat "\n" (itoa (setq i (1+ i))) " " (nth i path))) ; ) (textscr) (if (not LM:listbox)(load "listboxV1-2")) (setq pathnum (nth 0 (lm:listbox "Pick a path" path 2))) (setq path (nth pathnum path)) ;(setq path (nth (getint "\n>>>>>> Enter path's No " ) path)) (setq DWGlist nil) (dwgs path) ; (setq fn (getstring "enter file name to search for ")) (if (not AHgetval)(Load "getval")) (AHgetval "Enter file name eg *222* " 25 24) (setq fn item) (setq dwglist2 '()) (setq i -1) (repeat (length DWGlist) (setq file (nth (setq i (1+ i)) DWGlist)) (cond ((wcmatch (vl-filename-base file) fn)(setq dwglist2 (cons file dwglist2))) ) ) ;(setq ToOpen (getint "\nenter number of file to open\n")) (setq dwgnum (nth 0 (lm:listbox "Pick dwg to open" dwglist2 2))) (princ "\n>>>>>>") (command "fileopen" "y" (nth dwgnum dwglist)) ) ;grab all DWGs starting from PATH -including subfolders (defun DWGs(path) (setq lst (vl-directory-files path)) (foreach l1 lst (cond ((or (= l1 ".")(= l1 "..")) nil) ((vl-file-directory-p (strcat path "\\" l1))(dwgs(strcat path "\\" l1))) ((= (vl-filename-extension l1) ".dwg") (setq DWGlist (cons (strcat path "\\" l1) DWGlist))) ) ) ) getval.lsp
    1 point
  3. I only weakly read this topic, but I had one sub function from my library that may be of interest... (defun _findfiles ( libraryrootprefix filenamepattern / subs subfolderss subfs folders fl ) ;;; (_findfiles "F:\\ACAD ADDONS-NEW\\" "profile*.lsp") (defun subs ( folder ) (setq subfolders (vl-remove "." (vl-remove ".." (vl-directory-files folder nil -1)))) subfolders ) (defun subfolderss ( rootfolder / subfolders ) (subs rootfolder) (if subfolders (foreach sub subfolders (if (= (substr rootfolder (strlen rootfolder)) "\\") (progn (subfolderss (strcat rootfolder sub)) (setq subfs (cons (strcat rootfolder sub) subfs)) ) (progn (subfolderss (strcat rootfolder "\\" sub)) (setq subfs (cons (strcat rootfolder "\\" sub) subfs)) ) ) ) ) ) (if (/= (strlen libraryrootprefix) 3) (setq libraryrootprefix (vl-string-right-trim "\\" libraryrootprefix)) ) (subfolderss libraryrootprefix) (setq folders (append (list libraryrootprefix) subfs)) (foreach folder folders (foreach x (vl-directory-files (strcat folder "\\") filenamepattern 1) (setq fl (cons (strcat folder "\\" x) fl)) ) ) (reverse fl) ) I hope you'll find it useful... Regards, M.R.
    1 point
×
×
  • Create New...