Jump to content

Recommended Posts

Posted

Hi all,

 

I've been confidently programming in AutoLISP for a few years, but just now started dipping my toes into DCL. I have a quick question, because I think I've misunderstood what DCL can do for me.

 

Is it possible to have a DCL dialog displayed, and still be interacting with the drawing? What I mean is, after I issue the (start_dialog) command my lisp function freezes until you close the DCL window. Is it not possible to have that DCL dialog displayed and still have lisp code running?

 

An example of what I'd thought was possible:

1. User starts command MYCMD

2. Dialog box appears, with the text "you haven't clicked yet"

3. User clicks a point on the drawing

4. Dialog box text changes to "you clicked on (X,Y)"

5. Loop back to #3, until user exits MYCMD

6. Close dialog box

 

PS Yes, I understand the above is more easily done with (princ)'s or (grtext)'s, I'm just wanting to learn DCL capabilities.

Posted

Welcome to CADTutor :)

 

Standard DCL does not support modeless dialogs (only modal), and so unfortunately this is not possible.

 

If you wish to continue using AutoLISP for this task, you would need to look into using third-party software, such as OpenDCL or ObjectDCL.

 

Lee

Posted

Cheers Lee - disappointing, but at least I have confirmation of it.

 

Actually, for my simple project, I think I'm just going to bail out of using a DCL-like interface altogether, and just use (grread) coupled with your neat (LM:grtext) code (which is far better suited to what I need than the built-in (grtext) i mentioned earlier)

 

So, double-cheers then :)

Posted

IMO, dcl will be unloaded once the routine is finish.

Posted

KISS keep it simple s.....

(setq pt (getpoint "pick point"))
(setq x (car pt)
Y (cadr pt)
Z (caddr pt)
)
(alert (strcat "you have picked " (rtos X 2 2) "," (rtos Y 2 2)))

Posted

Well, yes, you can do what you are talking about with DCL, though it may not be a truly modeless way. And note that, in general, you don't want dialog boxes blocking the screen while the user is trying to pick a point anyway. Here is the link to a quick tutorial on "hiding" the dialog box: http://www.afralisp.net/dialog-control-language/tutorials/hiding-dialog-boxes.php. You can even nest dialogs. There's a link to that on the above webpage.

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...