View Full Version : New files and file folders
J-LYLE
20th Jan 2006, 08:10 pm
Im sure what im wanting is possable just not sure how to go about it. Im wanting so set up some kind of app that will create a folder with what ever jop# i put into it and then automaticaly create all the standard sub and sub-sub folders for each typical job. Any advise or sugesttions would be appreacited. Where should i start? :unsure:
Dommy2Hotty
20th Jan 2006, 08:38 pm
A few questions:
1. Do the subfolders require the job number to be within the names, or just the main folder?
2. Are there any standard items that are within the subfolders that are created?
Dommy2Hotty
20th Jan 2006, 08:57 pm
3. Are spaces allowed in the folder name?
J-LYLE
20th Jan 2006, 09:24 pm
1. no, just the main
2. not yet my thought process yet but could be posiable in the future
3. no need for spaces that i can think of, (but not a prop if thats what your asking).
The thought occured to me after posting the original question that depending on what type of job we were starting we could have some standard files copyed into the folders. But the thought is still in development since we do a few diffrent type of projects that would need diffrent files.
Dommy2Hotty
20th Jan 2006, 09:43 pm
I can write you a basic LISP program for it, if you'd like. It's something I've been writing for my company. Here is the foundation for the program:
(defun c:NewJobSetup (/ job folder)
(vl-load-com)
(setq job (getstring "\nJob number: ")
folder (strcat "C:\\" job "\\")
msg (strcat "\nFolder \"" job "\" created.")
);if
(if (vl-mkdir folder)
(alert (strcat "\nFolder \"" job "\" created."))
);if
(princ)
);defun
(princ "\n***** Command to start program : NewJobSetup *****")
EDIT: If you need to know what to do with that code, see HERE (http://cadtutor.net/forum/viewtopic.php?t=2942)
J-LYLE
20th Jan 2006, 11:18 pm
Hay thanks that works great, :D
:unsure: I was wondering though could i get it to create some sub folders too I tried to mess with it a little but with my limited knoledge im not getting anywhere fast. :huh:
(defun c:NewJobSetup (/ job folder s1 sub1)
(vl-load-com)
(setq job (getstring "\nJob number: ")
folder (strcat "C:\\job-test\\" job "\\")
msg (strcat "\nFolder \"" job "\" created.")
);if
(if (vl-mkdir folder)
(alert (strcat "\nFolder \"" job "\" created."))
(progn
(setq s1 ( Arch ))
sub1 (strcat "C:\\job-test\\" job "\\" s1 "\\")
(vl-mkdir sub1))
);if
(princ)
);defun
(princ "\n***** Command to start program : NewJobSetup *****")
Please go easy on me my lisping skills or lack ther of. im sure its rough around the edges. :oops:
If you had any words of wisdom for me i would greatly appreaciate them if not cool ill just keep plugin away till i get it or it blows up. o:)
Dommy2Hotty
20th Jan 2006, 11:31 pm
I just wanted to throw that out there to see that would work for you or not. Subfolders are not much different from the main folder. I'll give an example that you can modify and add to in a minute...
Dommy2Hotty
20th Jan 2006, 11:36 pm
Change "SUBFOLDER" to the name you want (i.e. "xrefs" or "blocks").
For more, follow the second set of code:
(defun c:NewJobSetup (/ job folder)
(vl-load-com)
(setq job (getstring "\nJob number: ")
folder (strcat "C:\\" job "\\")
sub1 (strcat folder "\\" "SUBFOLDER");**LINE ADDED**
)
(vl-mkdir folder)
(vl-mkdir sub1);**LINE ADDED**
(princ)
);defun
(princ "\n***** Command to start program : NewJobSetup *****")
For more subfolder, do as follows:
(defun c:NewJobSetup (/ job folder)
(vl-load-com)
(setq job (getstring "\nJob number: ")
folder (strcat "C:\\" job "\\")
sub1 (strcat folder "\\" "SUBFOLDER")
sub2 (strcat folder "\\" "SUBFOLDER2)"
sub3 (strcat folder "\\" "SUBFOLDER3")
)
(vl-mkdir folder)
(vl-mkdir sub1)
(vl-mkdir sub2)
(vl-mkdir sub3)
(princ)
);defun
(princ "\n***** Command to start program : NewJobSetup *****")
J-LYLE
23rd Jan 2006, 06:56 pm
Thanks :D so much that will speed thinks up for me a bit. I greatly appreaciate the lesson.
Dommy2Hotty
23rd Jan 2006, 07:05 pm
Thanks :D so much that will speed thinks up for me a bit. I greatly appreaciate the lesson.
No problem. I am to please. :twisted:
CadDog
19th Jun 2008, 06:03 pm
Change "SUBFOLDER" to the name you want (i.e. "xrefs" or "blocks").
For more, follow the second set of code:
(defun c:NewJobSetup (/ job folder)
(vl-load-com)
(setq job (getstring "\nJob number: ")
folder (strcat "C:\\" job "\\")
sub1 (strcat folder "\\" "SUBFOLDER");**LINE ADDED**
)
(vl-mkdir folder)
(vl-mkdir sub1);**LINE ADDED**
(princ)
);defun
(princ "\n***** Command to start program : NewJobSetup *****")
For more subfolder, do as follows:
(defun c:NewJobSetup (/ job folder)
(vl-load-com)
(setq job (getstring "\nJob number: ")
folder (strcat "C:\\" job "\\")
sub1 (strcat folder "\\" "SUBFOLDER")
sub2 (strcat folder "\\" "SUBFOLDER2")
sub3 (strcat folder "\\" "SUBFOLDER3")
)
(vl-mkdir folder)
(vl-mkdir sub1)
(vl-mkdir sub2)
(vl-mkdir sub3)
(princ)
);defun
(princ "\n***** Command to start program : NewJobSetup *****")
This one work great with a little fix...
but I need to go one more sub
C:\Job Number\Sub\Sub...
Thanks could you help me...???
Powered by vBulletin™ Version 4.1.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.