Tuesday, August 31, 2010

Instructions....YAWN.....how exciting...

I'm glad I did not just stick the handrial routine for free download. It seems a few instructions are needed. I like to think I'm OK at instructions, but there is a 20% of me that says "Room for improvement!"

I have sent the routine to a man, where he lives I don't know, but he has had an uphill battle to get the thing to work. Part of the problem is the method Autodesk used when it first designed lisp routines with dialog boxes. They made it so the main program was in one file, say HRAIL.LSP, and the dialog box was another file, say HRAIL.DCL. The usual problem is that Autocad cannot find where the dcl file is located. They probably had good reasons for their decision, but it has made it tricky for all from then on.

Here is the offending code from the lisp file:

(setq dcl_id (load_dialog "C:\Program Files\AutoCAD 2002\Lisp file\Holes/HRAIL.dcl"))
(if (not (new_dialog "hrail" dcl_id))

Autocad does not like it’s slashes “\” as in the old msdos days. You have to do it their funny way, ie “/”

So the corrected bit will be:

(setq dcl_id (load_dialog "C:/Program Files/AutoCAD 2002/Lisp file/Holes/HRAIL.dcl"))
(if (not (new_dialog "hrail" dcl_id))

I'm hoping this fixes the problem.

1 comment:

Paul Munford said...

It's worth a mention that you can compile Lisp (including DCL files) into a FAS file, which keeps it all together.

However, it was the frustration of working with DCL that lead me to first look at VB/VB.net. Which is not as daunting as you might think when you get into it...