Questions & Comments for

Dcl Dialogs

Main Menu
Submit a Question or Comment

Frequently Asked Questions & Comments

Q: What Dialog tiles that have text labels, is AutoLISP not able to pass the text string label values to?  
  A: The tiles boxed_column, boxed_row, radio_button, toggle, button, image_button, image, and icon_image are the most common.  
C: DclCalcs has helped me figure out the ratio of my images by using the pixel method. Also I like the list_box information.  
Q: In your AutoLISP functions you use symbols as the last character of some variable names. I see a pattern relating to the variable types. What symbols are you using so I can better understand your functions?  
  A: These symbols are not necessary for AutoLISP! Visual Basic and VBA have a similar convention for distinguishing variable types. Several years ago, when I started writing longer AutoLISP programs, I created the following symbol convention for variables so I could easily go back and debug functions months later. The variables ending with: # = integers, ~ = real numbers, $ = strings, @ = lists, & = selection sets, ^ = entity names, % = file opened, and : = sub-functions and icon image functions. The variables beginning with * are global variables and may end with one of the above symbols.  
Q: How can I setq my own variable names per the type of value it needs to be, such as integers and numbers, from the global dialog list? And are the numbers in some of your variables names important for the included functions to work?  
  A: The global dialog list variable *MyOtherLists@, from the example in the tutorial, returns a list of (nil “Sunday” “2000” “3.14159”). Use you own variable names per the following syntax: (setq Day$ (nth 1 *MyOtherLists@)) = “Sunday”, (setq NumYears# (atoi (nth 2 *MyOtherLists@))) = 2000, (setq RealNum~ (atof (nth 3 *MyOtherLists@))) = 3.14159. The numbers used in some of the dialog variable names are not important. They are simply used in the examples to make it easier for you to trace where certain variables are used.  
Q: I really like the way you did the DclCalcs_Info: sub-function in DclCalcs. Can you relay as to how you arrived at the width value for (setq Phrases@ (PhraseList Info$ 36.76))?  
  A: Enter the width you chose for your list_box from your dcl file into the Width edit box of the DclCalcs function/Images and Tiles section. Change your dcl width if needed to the new value. Note the number for the X Pixels. If your text information or the number of lines you want to display require it to scroll, subtract 21 from the X Pixels value, else subtract 6 if no scroll required. Note the new Width value and use it for the width value for the PhraseList DclWidth~ argument.  
Q: We have been reviewing your AutoLISP and dcl files, MyDialogs.lsp and MyDialogs.dcl, here at work. The sub-function MyImageButton, that displays a computer monitor from different views as you pick on the image, has given us some ideas that we'd like to incorporate in our own dialog programs. We have a Parts Library program that currently displays slides. We would like to be able to add a similar feature to display the parts in other 3D views as you pick on the image. Is there very much work involved in creating vector images of these parts, or should we stay with slide images instead?  
  A: In your Parts Library you may easily add additional slides with minimum effort. Slides are created based upon the users' current aspect ratio of the drawing area. This ratio is affected by the number of toolbars added to the top and sides, and the number of command lines. To display slides closer to the ratio of your image tile, you may have to adjust the aspect ratio of your drawing area. This is more difficult to achieve if your desired ratio for an image tile is more squared or more of a vertical rectangle shape.
In your Parts Library you may also use vector images with a little work. In the last section of Part 1 of the tutorial I cover creating your own icon images. This is the basics of what it's all about. In Part 2 of the tutorial I will be including GetVectors.lsp and GetVectors.dcl. This program makes it very easy to create vector image functions with precise control over the aspect ratio of the image. Review the instructions at the top of the file.
Q: I downloaded your AutoLISP program GetIcon.lsp from the following URL:
It's very good and easy to use. Also it's nice and similar to VBA. Is it possible for me to create and add my own icons?
  A: Yes, you can and it's fairly easy and fun. Read the last two paragraphs at the end of the Tutorial about icons, to get the basics. The main thing to remember is that your drawing area is a 32x32 grid. Then follow the example below:
(defun YourIcon: ( ) ; <-- The function name ends with a colon ":"
(start_image "youricon") ; <-- The tile name is lower case, without a colon ":"
Have fun with it. At first try a few simple things to see how it's working. It is very easy to test as you make changes.
Just type
(GetOk "" "" "youricon") ; <-- The icon name here is not case sensitive, but leave out the colon ":".
Q: I searched your website for the AutoLISP function ViewDcl.lsp. Where can I find it so I can download it?  
  A: Currently ViewDcl is part of the MyDialogs support utilities. You may download MyDialogs.lsp and MyDialogs.dcl from the tutorial page by using the Download Files tab at the top, or by going to the main AutoLISP Exchange website, ViewDcl also uses the functions WordList and NoSpaces, which are part of the MyDialogs support utilities.
P.S. ViewDcl has now been added to the main page.
Q: Thank you very much! I think your examples are finally going to give me the help I need to be able to understand and use DCL. The function (MyEditText " My Edit Text" "") returns: MyEditText; error: too many arguments, when I run it. I discovered the problem when trying to develop a similar dialog using yours as an example. When I was unable to find any major difference between my example and yours, I ran yours. Am I doing something wrong, or is there a small problem with your example that you might be able to help me to resolve for use in my similar example?  
  A: I pasted your example on the AutoCAD command line and it works as usual. Is it possible that you may have created another function named MyEditText in another file? Do me a favor and download the files Search.lsp and Search.dcl from: They are near the bottom of the page. This is a very handy utility to include in your AutoLISP tools. You will also need to download GetIcon.lsp if you haven't yet. Then load and run "Search" and enter "defun MyEditText" for the word or phrase to search for. Then verify that the path to search in, is where you stored your files. My search results returned:
Search of "defun MyEditText" in *.lsp file(s) in the E:\AutoCAD\ folder.
[ MyDialogs.lsp ]-------------------------------------------------------
(defun MyEditText (Title$ Edit1$ / Dcl_Id% NewText$ Return#)
);defun MyEditText

Notice that the function has two arguments, Title$ and Edit1$. Then a forward slash to separate the arguments from the local variables, Dcl_Id%, NewText$ and Return#. If the version that you have been revising has the forward slash in a different place, this is the cause for the error message: too many arguments. It might be a good idea to copy and paste the functions and dialogs that you want to modify just below the original ones. Be sure to rename the new functions and dialogs. This way you can scroll up to view the originals as you make changes.
Q: I'm fairly new to programming with dialogs, and I've learned a lot from the tutorial. I'm especially interested in the method you are using with the Other option with popup_list. I copied the MyOtherLists function from MyDialogs.lsp into a separate lsp file, and copied the MyOtherLists dialog definition from MyDialogs.dcl into a separate dcl file also. When I load and run MyOtherLists I get the following error message. "error: no function definition: SET_TILE_LIST" This function is missing from the MyOtherLists function. Can you please email it to me so I can get my own MyOtherLists function to work correctly?  
  A: All of the support functions are included within the MyDialogs.lsp file. In many of the functions you will notice a comment like, ;*Included, on the end of certain lines. This means that the function that this line is referring to is included within the support functions in the MyDialogs.lsp file. Search for the functions required where the lines ended with the comment, ;*Included, and copy and paste those functions at the end of your own AutoLISP file. Several people have requested help with MyOtherLists and MyEditBoxes to work outside of the MyDialogs.lsp file. I've created template files named OtherLists.lsp and OtherLists.dcl which include the required support functions to run. The two main functions are OtherLists and EditBoxes. The dialog tiles within the OtherLists.dcl file may be combined into your own dialog file as described in the notes near the top of the OtherLists.lsp file.
C: Just wanted to let you know that your DCL Tutorial is great. It's nicely laid out and even I can understand. I needed a slide library with a next_back_cancel and it was just about all there.
Thanks for sharing.
  A: You're welcome. Notice that it stores the dialog variables in a global list so the next time you switch to that dialog it remembers the previous variable settings.  
Return to Dcl Dialogs Tutorial