TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: whdjr on September 30, 2005, 10:09:13 AM

Title: Can't load a temporary dcl file
Post by: whdjr on September 30, 2005, 10:09:13 AM
Can you load a temporary dcl file?

I made a dcl file using 'vl-filename-mktemp' in my Acad temp location.  When I try to load it I get a negative number which means it can't find it.  What gives?
Title: Re: Can't load a temporary dcl file
Post by: MP on September 30, 2005, 10:11:22 AM
Did you include the full path and extension? I've done the very thing you asked succesfully, even with non .dcl file extensions.
Title: Re: Can't load a temporary dcl file
Post by: whdjr on September 30, 2005, 10:28:19 AM
Ok, after your comment MP I reread my code and I found the error of my ways.  I tried to put this
Code: [Select]
(strcat (vl-filename-base dcl_name) ".dcl")in my load statement and actually I meant to put it in the 'new_dialog' statement.

Now my problem is if I put the full path or just the filename in the 'new_dialog' statement it tells me it can't find the definition.  What gives now?
Title: Re: Can't load a temporary dcl file
Post by: MP on September 30, 2005, 10:34:36 AM
Assuming you open the filename returned by vl-filename-mktemp, write valid dcl code to it and then close it you would have to subsequently load it by passing its full path to the load_dialog statement.

PS: Once it successfully loads you can immediately 86 it if you wish.
Title: Re: Can't load a temporary dcl file
Post by: whdjr on September 30, 2005, 10:55:37 AM
Once again I see the light.
I was trying to put the name of the dcl file into the new_dialog statement instead of the name of the dialog box I was calling.  Duhhh. :oops:

Thanks MP.  Sometimes it helps just to talk about things to other people and then as your explaining it the light come on.  ;-)
Title: Re: Can't load a temporary dcl file
Post by: MP on September 30, 2005, 11:04:15 AM
I'm sorry, our time is up for today, I'll see you next Friday. Karen has some papers for you to sign on your way out.







Kidding! Couldn't resist the 'head shrink' reference. Glad you got it worked out. You're right, this place does make a great chalk board sometimes.

:)