Jump to content

Recommended Posts

Posted

but "scriptlist" variable is also used at the end which is why it's set up front...right? :unsure:

  • Replies 28
  • Created
  • Last Reply

Top Posters In This Topic

  • jmerch

    13

  • MSasu

    7

  • BlackBox

    5

  • LibertyOne

    2

Posted

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! :beer:

Posted
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.

Posted

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)))
   )

Posted

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

Posted

I added (vl-load-com) at the beginning, and the .dcl is already in my search path. Still not working.

Posted

:shock: 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]))

Posted

For this reason I have proposed to remove the extensions only at display, not in the file list...

 

Regards,

Mircea

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...