Look for and CREATE OR SET FOLDER for quick plot routine

Look for and CREATE OR SET FOLDER for quick plot routine

DC-MWA
Collaborator Collaborator
1,129 Views
6 Replies
Message 1 of 7

Look for and CREATE OR SET FOLDER for quick plot routine

DC-MWA
Collaborator
Collaborator

I have a program for fast plots to pdf. It makes the pdf's using the drawing name and puts them in the current drawing folder.

I need have the program look for a folder named "QUICK PLOTS" in the current drawing folder, if it finds it, put the pdf file in that folder. If the folder does not exist, make the folder and then put the pdf in the new folder.

 

Thank you in advance for any assistance.

 

0 Likes
Accepted solutions (1)
1,130 Views
6 Replies
Replies (6)
Message 2 of 7

Moshe-A
Mentor
Mentor

@DC-MWA

 

i see that you are very active and that good Smiley LOL

to achieve what you want, look at these functions:

 

(vl-directory-files)

(vl-mkdir)

 

0 Likes
Message 3 of 7

DC-MWA
Collaborator
Collaborator

With my limited knowledge I think I could use vl-mkdir to make the directory, but to have it check to see if the directory exists, make it or set it and then incorporate it into the program....

Way above my head.

0 Likes
Message 4 of 7

john.uhden
Mentor
Mentor
Accepted solution
(and
(= (getvar "dwgtitled") 1) (vl-load-com)
(setq *doc* (vla-get-activedocument (vlax-get-acad-object))) (setq path (vl-filename-directory (vlax-get *doc* 'fullname))) (or (vl-file-directory-p (strcat path "\\Quick Plots")) (vl-mkdir (strcat path "\\Quick Plots")) ) )

John F. Uhden

0 Likes
Message 5 of 7

dbhunia
Advisor
Advisor

Hi,

 

Check the attached Code for one pattern "P42".......(it has been tested in Autocad 2017).......

 

For your information the below line may vary according to Autocad Version.....

 

(command "-plot" "yes" "" "DWG TO PDF.PC3" "ARCH expand E1 (30.00 x 42.00 Inches)" "Inches" "Landscape" "n" "extents" "1:1" ".113427,.113168" "y" "monochrome.ctb" "n" "A" file "n" "Y")


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 6 of 7

maratovich
Advisor
Advisor

Attach an example of your dwg file
I need an example of your title block.

 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 7 of 7

DC-MWA
Collaborator
Collaborator

thank you very much!!!

0 Likes