aloy Posted June 27, 2012 Posted June 27, 2012 How are the various dialogs in AUtoCAD created?. Is it by Lisp or .Net languages. If it is by .Net how can we enter it, create and use it. Thanking in advance. Quote
BlackBox Posted June 27, 2012 Posted June 27, 2012 One can create or employ dialogs in AutoCAD from various sources. The simplest way to start out, is to use DOSLib's dialog functions, as one need only look through the help documentation, load the applicable ARX file and voila. Next is to learn DCL (or OpenDCL), which works with LISP. Standard DCL is native to AutoCAD, meanin that all you need is AutoCAD, which includes the VLIDE. With .NET you get true, complete customization possibilities, however this both requires Visual Studio (Express or Full), the AutoCAD ObjectARX SDK for your version, and a significant learning curve if you're not already adept at .NET technologies. HTH Quote
BIGAL Posted June 27, 2012 Posted June 27, 2012 (edited) Here is an example dcl with some extra smarts the Title can be changed it returns variable ITEM as a string, load the getval.lsp thanks to Alanjt for original concept. ;; Input Dialog box with variable title ;; By BIGAL June 2012 ;; code (ah:getval title) (defun AH:Getval (title / fo) (setq fname "C://getval.dcl") (setq fo (open fname "w")) (write-line "ddgetval : dialog {" fo) (write-line " : row {" fo) (write-line ": edit_box {" fo) (write-line (strcat " key = " (chr 34) "sizze" (chr 34) ";") fo) (write-line (strcat " label = " (chr 34) title (chr 34) ";" ) fo) (write-line " edit_width = 18;" fo) (write-line " edit_limit = 15;" fo) (write-line " is_enabled = true;" fo) (write-line " }" fo) (write-line " }" fo) (write-line "ok_cancel;}" fo) (close fo) (setq dcl_id (load_dialog "c:\\getval")) (if (not (new_dialog "ddgetval" dcl_id)) (exit)) (action_tile "sizze" "(setq item $value)(done_dialog)") (mode_tile "sizze" 3) (start_dialog) ; returns the value of item ) now do this lisp (setq title "Please enter something here") (ah:getval title) (Princ item) Edited June 29, 2012 by BIGAL code fixed Quote
MSasu Posted June 27, 2012 Posted June 27, 2012 For built-in DCL technology you may check the tutorials from AfraLISP. Quote
BlackBox Posted June 27, 2012 Posted June 27, 2012 http://www.lee-mac.com also has some great tutorials. Quote
aloy Posted June 27, 2012 Author Posted June 27, 2012 Thank you all; this forum is really helpful. I will try all the methods suggested. I think I will give special attention to .Net. RenderMan gave me advise saying it is only $0.02 worth, to look into C3D which I did. It was great help as I found that what it has implemented is almost the same I was attempting at in Lisp in the case of road alignments and profiles. Quote
aloy Posted June 27, 2012 Author Posted June 27, 2012 Hi BIGAL, Thank you for the code. I need to give location of 'GetVal.dcl', where to find it?. Also we need to give name of dialog with a Getstring function in the lisp?. Regards. Quote
MSasu Posted June 27, 2012 Posted June 27, 2012 You should fix this in BIGAL's code: (setq fname "C://getval.dcl") ... (setq dcl_id (load_dialog "c:\\[s][color=red]acadtemp\\[/color][/s][color=#000000]getval"))[/color] Or: (setq fname "C:[color=red]\\[/color]getval.dcl") ... (setq dcl_id (load_dialog [color=red]fname[/color][color=#000000]))[/color] Quote
aloy Posted June 27, 2012 Author Posted June 27, 2012 MSasu, Thanks, it works in DCL Regards, Aloy Quote
BIGAL Posted June 28, 2012 Posted June 28, 2012 Sorry changed one of the "acadtemp" in the code forgot the other tried to make it work for anyone. As its constantly rewritten put it in our temp directory which gets cleaned up all the time. Quote
aloy Posted June 28, 2012 Author Posted June 28, 2012 BIGAL, Thanks, it already works. It also gave me an idea how to implement similar things. Regards, Aloy Quote
Recommended Posts
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.