jmerch Posted January 26, 2012 Author Posted January 26, 2012 but "scriptlist" variable is also used at the end which is why it's set up front...right? Quote
Lee Mac Posted January 26, 2012 Posted January 26, 2012 (foreach file scriptlist (add_list (vl-filename-base file))) Quote
BlackBox Posted January 26, 2012 Posted January 26, 2012 Sorry for any confusion; I asked my question more conceptually speaking, as I'm a neophyte when it comes to DCL. Thanks for the example, Lee. Cheers! Quote
jmerch Posted January 26, 2012 Author Posted January 26, 2012 Sorry for any confusion; I asked my question more conceptually speaking, as I'm a neophyte when it comes to DCL. No problem, I understand there's more than once way to do this stuff...I enjoy seeing the different possibilities. It helps me understand it a little better if I see if a different way. Quote
jmerch Posted January 27, 2012 Author Posted January 27, 2012 Now I'm loosing my mind...it worked the other day...now it does not. (setq scriptlist (mapcar 'vl-filename-base (vl-directory-files "Z:/CAD/CAD-MECH/PM Shared/Scripts" "*.cod" 1))) (setq DCLid (load_dialog "Scripts.dcl")) (if(not(new_dialog "Scripts" DCLid))(exit)) (start_list "scr_list") (mapcar 'add_list scriptlist) (end_list) (action_tile "accept" "(setq mytile (atoi(get_tile \"scr_list\")))(done_dialog 1)") (action_tile "cancel" "(done_dialog 0)") (start_dialog) (unload_dialog DCLid) (if (= (getvar "DIASTAT") 1) (executescript (strcat "Z:/CAD/CAD-MECH/PM Shared/Scripts/" (nth mytile scriptlist))) ) Quote
MSasu Posted January 28, 2012 Posted January 28, 2012 Did you loaded Visual LISP's extension? (vl-load-com) Is the DCL file located in AutoCAD's search path? If not, you may add it or hard-code the path: (setq DCLid (load_dialog "[color=blue]X:\\MyDialogs\\[/color]Scripts.dcl")) Regards, Mircea Quote
jmerch Posted January 28, 2012 Author Posted January 28, 2012 I added (vl-load-com) at the beginning, and the .dcl is already in my search path. Still not working. Quote
jmerch Posted January 31, 2012 Author Posted January 31, 2012 I figured it out...it's always the little things. (executescript (strcat "Z:/CAD/CAD-MECH/PM Shared/Scripts/" (nth mytile scriptlist)[color=red] ".cod"[/color])) Quote
MSasu Posted January 31, 2012 Posted January 31, 2012 For this reason I have proposed to remove the extensions only at display, not in the file list... Regards, Mircea Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.