Author Topic: common dialog rewrite  (Read 1286 times)

0 Members and 1 Guest are viewing this topic.

stefano

  • Mosquito
  • Posts: 2
common dialog rewrite
« on: February 28, 2013, 08:39:10 AM »
Hello Swampers,
I have to redefine the commands open and saveas showing my custom windows similar to those of standard autocad but with limited navigation to only a folder (and subfolders) in a network server.
Do you have any suggestions?
Thanks in advance

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: common dialog rewrite
« Reply #1 on: February 28, 2013, 09:45:48 AM »
Maybe this :

Code - Auto/Visual Lisp: [Select]
  1. (defun c:oopen ( / f d ) (vl-load-com)
  2.   (setq f (getfiled "Select file to open" "\\" "dwg" 16)) ;; Instead of "\\" put your starting path in form "X:\\BLA1\\BLA2\\"
  3.   (vlax-for x d
  4.     (if (eq (vla-get-fullname x) f)
  5.       (vla-activate x)
  6.     )
  7.   )
  8.   (princ)
  9. )
  10.  
  11. (defun c:ssave ( / f )
  12.   (setq f (getfiled "Type file to save" "\\" "dwg" 1)) ;; Instead of "\\" put your starting path in form "X:\\BLA1\\BLA2\\"
  13.   (command "_.save" f)
  14.   (princ)
  15. )
  16.  
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

stefano

  • Mosquito
  • Posts: 2
Re: common dialog rewrite
« Reply #2 on: February 28, 2013, 12:43:15 PM »
Hello ribarm,
thank you for the quick response  :-D
I know getfiled function but I would I would like customize the drive dropdownlist to see ONLY the predefined start folder and subfolders, as did Terry in "BrowseForFolder" function in this page http://forums.augi.com/showthread.php?80029-Obtaining-a-directory-path-via-a-dialog , but I have to do in the "open" and "save as" windows.
I hope I was clear
Thanks again.