Exchange Forum > Dcl Dialogs
Preview in dialog
Preview in dialog

#1

Spakis
Join Date:
08-08-2008
Anybody knows how to make a dialog with a preview?
For example like one in an array command dialog.
Preview in dialog

#2

Flynn
Join Date:
07-24-2007
Spakis,
That's a very good question. I've attached a preview of what the array dialog displays. If you are referring to the image in the upper right corner that changes as the user enters different values, it can be done in AutoLISP with the vector_image function and some extra programming.
Flynn



Attachments  Array.gif  
Preview in dialog

#3

Spakis
Join Date:
08-08-2008
Thanks for reply.
Yes, that's exactly what I'm referring to.
I believe with vector_image function it is possible to draw just about anything in dialog box, if so this will work fine for me.
 
And that white square with a shadow could be static image?
Preview in dialog

#4

Flynn
Join Date:
07-24-2007
Quote:
And that white square with a shadow could be static image?
Yes you are right! You would just draw a rectangle in black and then outline two sides to create the shadow effect.
Preview in dialog

#5

Spakis
Join Date:
08-08-2008
Thanks, for your help Flynn.
I have one more question. Is there any way to call standard windows browse dialog box from autolisp?
Preview in dialog

#6

Terry Cadd
Join Date:
09-10-2007
Hi spakis,
I read your post and I may have a version that you can try out.
This is something that I have been tweaking from a related thread on AUGI.
I hope this helps.
Terry
 
Code:
;-------------------------------------------------------------------------------
; BrowseForFolder - Dialog to browse for a folder
; Arguments: 2
;   Message$ = Message line
;   Directory$ = Default folder
; Syntax: (BrowseForFolder "\nTo view any subfolders, click a plus sign below." "C:\\")
; Returns: Name of folder selected
;-------------------------------------------------------------------------------
(defun BrowseForFolder (Message$ Directory$ / FolderObj FolderPath$ ShellApp)
  (setq ShellApp (vlax-create-object "Shell.Application"))
  (if (setq FolderObj (vlax-invoke ShellApp 'BrowseForFolder 0 Message$ 512 Directory$))
    (progn
      (setq FolderPath$ (vlax-get-property (vlax-get-property FolderObj 'Self) 'Path))
      (if (/= (substr FolderPath$ (strlen FolderPath$)) "\\")
        (setq FolderPath$ (strcat FolderPath$ "\\"))
      );if
    );progn
  );if
  (vlax-release-object ShellApp)
  FolderPath$
);defun BrowseForFolder
Preview in dialog

#7

Buzzard
Join Date:
12-25-2007
Hey Spakis,
 
I was not sure if you meant the browser command to go to a web page, But here it is.
 
Try this simple add in:
Code:
  (start_dialog)                                                       ;Start dialog
  (unload_dialog dcl_id)                                               ;Unload dialog
  (if blineclick                                                       ;If Cooper B-Line button is pressed
    (progn                                                             ;Start of progn
      (command "browser" "http://cooperbline.com/")                    ;Start browser command and GOTO cooperbline.com
    )                                                                  ;End of progn
  )                                                                    ;End of if
  (setq blineclick nil)                                                ;Set blineclick variable to nil
 
Here the button in the dcl:
Code:
: button {
label = "Go To Cooper B-Line";
key = "bline";
mnemonic = "B";
fixed_width = true;
is_bline = true;
}
 
The Buzzard
Preview in dialog

#8

Spakis
Join Date:
08-08-2008
Thanks, a lot Terry Cadd that's exactly what I was looking for.
Preview in dialog

#9

Terry Cadd
Join Date:
09-10-2007
Spakis,
Thanks for the reply. But you know what? As far as a browser for AutoCAD drawings for my code, I still use this generic version. I've been using this method so the AutoCAD users can also view the drawings in the folder they are selecting. It uses the global variable *LastPath$ to remember the last folder selected. Try it out also.
Terry
Code:
(defun GetPathName (/ PathFile$)
  (if (not *LastPath$)
    (setq *LastPath$ (getvar "DWGPREFIX"))
  );if
  (if (setq PathFile$ (getfiled "Select a Drawing in a folder for Folder name" *LastPath$ "dwg" 2))
    (setq *LastPath$ (strcat (vl-filename-directory PathFile$) "\\"))
  );if
);defun GetPathName
Preview in dialog

#10

Spakis
Join Date:
08-08-2008
Nice piece of code.
I was going to use something like this if I wouldn't be able to call 'browse for folder' dialog box.