CadGuruCool
Knowledge Base



Its only here that you will find a list of DCL errors and common pitfalls with their remedies not otherwise found even in the AutoCAD Documentation.

Underscore not dash

Observe the following DCL Statement:

 : edit-box {
 label = "Length:" ;
 ... ;
 }
 
Try to spot the syntactical error.

The code appears to be perfectly OK except note that, in the first line, the keyword should be "edit_box" and not "edit-box" as it appears.
 
Missing " = "

Observe the following DCL part code:

 : image_button {
 width 60 ;
 height 45 ;
 ... ;
 } 
 
Here the "=" between the attribute name "length" and its value "60" is cooly missing.
 
Missing ;

Observe the following DCL part listing:

 : slider {
 max_value = 200 
 min_value = 45 
 ... 
 } 
 
This time, the ";" at the end of the statements are missing.
 
Use a Dash

Observe the following AutoLISP part listing:

 (defun c:add_list()
   (AutoLISP_statements)
   (AutoLISP_statements)
 )
 
Here, the function add_list is a AutoLISP function and can be re-defined.

The problem lies when you call the function normally and it gives an error as follows :

 (start_list The_List)
   (Add_List "data1")
 (end_list)
 
Try using add-list instead.
 
Using Set_Tile

  Autodesk warns : Do not use the set_tile function between start_list and end_list function calls.
 
JPEG Images in a Dialog

DCL allows using slide (.sld) images to display in a image tile.

Filling the drawing with hatch and wide polylines also does not serve the purpose.

Insert a jpeg or bmp image into a drawing using the imageattach command.

Size it to fill the entire screen

Now make the slide using the mslide command.

The slide will be displayed with the jpeg or bmp image in it.
 
Done_Dialog Usage Note

If you provide a callback for the button whose key is "accept" or "cancel" (usually the OK and Cancel buttons), the callback must call done_dialog explicitly.

If it doesn't, the user can be trapped in the dialog box. If you don't provide an explicit callback for these buttons and use the standard exit buttons, AutoCAD handles them automatically. Also, an explicit AutoLISP action for the "accept" button must specify a status of 1 (or an application-defined value).

Otherwise, start_dialog returns the default value, 0, which makes it appear as if the dialog box was canceled.
 

Home
Source Code 1 2 3   |   Queries and solutions   |   AutoLISP Projects
Tips n Tricks   |   Knowledge Base   |   Tutorials 4U   | Daily AutoLISP Code
CAD Standards   |   Fatal Errors   |   Real ACAD User   |   CAD Cartoons
CAD CrossWord   |   CAD Games   |   CAD Puzzle   |   CAD Illusions   |   CAD Cans
Easter Egg   |   CAD WinAmp Skins   |   Seven Habits   |   About Me

Also visit :   CadGuruCool   |   SeGuruCool   |   ProeGuruCool