Jump to content

A question about DCL


Russello

Recommended Posts

Hello again Masters and Legends, I'm currently learning DCL right now thru Afralisp.net and some autodesk forum topics. From their examples, a DCL file is paired with a LSP file to work.

 

For example, I have a DCL and its pair LSP file, its function is just to collect names, some numbers, places, (and any other data). Is it possible that any other LSP routine can use the data stored/inputted on the DCL? If it is, how? I just dont know.

 

Thanks again. more power! 8)

Link to comment
Share on other sites

Any value you store in a variable is available as long as you do not localise it. I use opendcl for all my dialog boxes it's much faster and flexible.

 

Sent from my Pixel XL using Tapatalk

Link to comment
Share on other sites

You could create a DCL file on-the-fly from the lisp code, load and start the dialog, then collect the required input and close the dialog and erase the temporary dcl file.

Heres an example:

 

(defun C:test ( / dcl des dch dcf rtn )
 ;; Example to create DCL on-the-fly and gather input(s)
 ;; Modified version, original by: Lee Mac
 (defun *error* ( msg )
   (and (< 0 dch) (unload_dialog dch))
   (and (eq 'FILE (type des)) (close des))
   (and (eq 'STR (type dcl)) (findfile dcl) (vl-file-delete dcl))
   (and msg (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\nError: " msg)))) (princ)
 ); defun *error*
 
 (and 
   (setq dcl (vl-filename-mktemp nil nil ".dcl"))
   (setq des (open dcl "w"))
   (princ 
     (strcat 
       "test : dialog"
       "{ label = \"Get String\";"
       "  : column"
       "  { children_alignment = centered;"
       "    : text { value = \"Your input: \"; }"
       "    : edit_box { key = \"eb\"; edit_width = 26; }"
       "  }"
       "  spacer_1; ok_cancel;"
       "}"
     ); strcat
     des
   )
   (not (setq des (close des)))
   (< 0 (setq dch (load_dialog dcl)))
   (new_dialog "test" dch)
   (action_tile "eb" "(setq rtn $value)")
   (= 1 (setq dcf (start_dialog)))
   (princ rtn)
 ); and 
 
 (*error* nil) (princ)
); defun C:test 

Link to comment
Share on other sites

Like Grr there are examples here for on the fly DCL for LIST selection check Lee-mac.com I have a 1 2 3 enter values dcl, the thing here is that you supply the text message request, another is an unlimited version of the 123 only limited by a practical screen limit.

 

; this is all that is needed for a 3 value request 2 lines of code
; its version 2 as it also has default values so you can just go OK
(if (not AH:GETVAL3)(load "getvals3"))
(ah:getval3 "Enter Hor scale" 5 4 "100" "Enter Ver Scale" 5 4 "50" "Enter Dec places" 5 4 "2")

ScreenShot095.jpg

GETVALS3.lsp

Edited by BIGAL
Link to comment
Share on other sites

Hello Master dan113, Grrr, & BIGAL ! Thank you again for your insights and for always answering in my threads. I will try my best to digest these things.

 

dan113,

im currently reading the tutorials for opendcl. wish me luck. hehehe

 

Thank you again my Masters

 

Kind Regards,

Russello

Link to comment
Share on other sites

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