Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted (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 by BIGAL
code fixed
Posted

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.

Posted

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.

Posted

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]

Posted

MSasu,

Thanks, it works in DCL

Regards,

Aloy

Posted

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.

Posted

BIGAL,

Thanks, it already works. It also gave me an idea how to implement similar things.

Regards,

Aloy

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...