ynotrobits Posted September 11, 2012 Posted September 11, 2012 I have the "getfiled" function installed in one of my Lisps. When the user needs to store a file location, it should always be in the same folder: H:\Job Specs. However, getfiled always defaults to: C:\Program Files\AutoCAD 2010 from which the user then has to navigate to the H drive. Does anyone know if there is a method and/or registry location where I can set the H drive location as a default? thank you for looking Quote
Lee Mac Posted September 11, 2012 Posted September 11, 2012 Read the documentation: getfiled Note the 'default' argument, set this to "H:\\Job Specs\\" Quote
dpolsky Posted January 4, 2013 Posted January 4, 2013 Hi, I've been looking everywhere for how to do this and the answer was really helpful! However, I would like to take this a step further and have it default to the directory that the current drawing is saved to, is this possible? I'm exporting a Flat Pattern DWG from inventor into the directory with the AutoCAD drawing, and I am then running my LISP routine to insert that DWG into my current drawing, explode it, merge layers, etc. It would be perfect if I could just get GetFiled to open straight into the current directory. I was starting to wonder if I could have the LISP routine define what the current directory is, save it as a variable and then use that variable as my dafault directory maybe that could work, but it's a little above me and I'm researching it now so any direction would be great! Thanks! Daniel Quote
dpolsky Posted January 4, 2013 Posted January 4, 2013 I'm answering my own question because I found it pretty quick after posting and thought it would be helpful to someone else.. If you want the directory to default to the current directory of the current drawing use (getvar "dwgprefix"). Example: (setq fn (getfiled "Text Export File" (getvar "dwgprefix") "txt" 1)) Credit to T.Willey from AutoDesk's Forums. http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Lisp-to-open-to-current-directory/td-p/.UObco2_7J8E Quote
Lee Mac Posted January 4, 2013 Posted January 4, 2013 (getfiled "Select File" (getvar 'dwgprefix) "" 16) Welcome to CADTutor Daniel 1 Quote
pBe Posted January 4, 2013 Posted January 4, 2013 (getvar 'Dwgprefix") for default argument . is this a trick question? EDIT: Oops... wait a minute Lee, one minute your're not there, and then BAM!!! my reply is one post down. Quote
dpolsky Posted January 4, 2013 Posted January 4, 2013 Hi thanks, I found it shortly after I posted, and I tried to reply again, but it wanted admin authorization. And no, I don't ask trick questions, I ask obvious questions I don't know the answers to =) I learned enough LISP in school to know I can do anything with it, and how to get started and then get stuck =) Quote
BIGAL Posted January 5, 2013 Posted January 5, 2013 Another that may be usefull Dwgprefix & Dwgname You can also add your file supports paths automatically Quote
Bill Tillman Posted January 5, 2013 Posted January 5, 2013 BIGAL that is true, but I would add, especially if you're doing this for a team of designers to work with, remove any changes you made to the support path when the LISP exits. Users are very territorial when it comes to making changes on their system. Quote
BlackBox Posted January 5, 2013 Posted January 5, 2013 In my limited experience, the owner of one's system is relative... and depends on the group you're working for or with. I used to work for a very large, multi-disciplinary group where one person controlled everything about our setup, where my needing to add a PC3 file to the network for the new printer in our building was a 45 minute phone call. The small group I work for now has absolutely no CAD standards whatsoever, and after nearly a year of pushing for some semblance for same has been discarded as not necessary... I couldn't even prit the plans for a specific project when that project's tech had a famil emergency... Until I got IT to export his profile only to find out that he was storing client-specific CTB, etc in the project folder instead of on the server with the rest of the clients data. Quote
Least Posted November 6, 2019 Posted November 6, 2019 Taking this old thread a little further, how can I use the (getvar 'dwgprefix) and set the save drawing name together? (setq PreFileName (getfiled "Input name of PRE drawing to save" ( strcat File_PreName FileName) "dwg" 1)) how to add (getvar 'dwgprefix) so that the current drawing path is selected? if I try to combine them I of course get a to many arguments error. Thanks P This is the full function: ;SAVE_PRE = save copy of drawing as pre-state (defun C:SAVE_PRE () (setq File_PreName "PRE-") (setq FileName (getvar "DWGNAME")) (setq PreFileName (getfiled "Input name of PRE drawing to save" (strcat File_PreName FileName) "dwg" 1)) (if (findfile PrefileName) (command-s "_SAVE" PreFileName "Y") (command-s "_SAVE" PreFileName) ) (princ (strcat "\n" File_PreName "File saved as '" (vl-filename-base PreFileName) "'.\n")) (princ) ) Quote
pkenewell Posted November 7, 2019 Posted November 7, 2019 16 hours ago, Least said: ow to add (getvar 'dwgprefix) so that the current drawing path is selected? if I try to combine them I of course get a to many arguments error. @Least All you have to do is include the (getvar "dwgprefix") within the (strcat ..) part: (getfiled "Input name of PRE drawing to save" (strcat File_PreName FileName) "dwg" 1) to (getfiled "Input name of PRE drawing to save" (strcat (getvar "dwgprefix") File_PreName FileName) "dwg" 1) Quote
Least Posted November 11, 2019 Posted November 11, 2019 Just the job. works just how I want it. Thanks 1 Quote
Recommended Posts
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.