Jump to content

New coder needing help! I have cookies


oakabogie89

Recommended Posts

Hi everyone,

 

When I'm working on a project I currently need to download a compressed DWGs folders online and store it into a project folder I setup. From there I unzip the folder, open up each drawing individually (the number of drawings vary for each project), and then print out each drawing individually to PDF. I'm new to coding, and am not sure if this is realistic, but is there a way to automate the process I just listed above, or is that too ambitious? If anything, just having some kind of script to just print all the DWG files in that folder to PDFs, and then have those PDFs stored in that same folder would be sweet.

Link to comment
Share on other sites

Like Blackbox further info needed, do the dwg's have multiple layouts, do you know the name of the layouts before you start ? With Full Autocad you can do plot all with no user interaction. It may be possible to copy and paste to the command line a sequence of plot and change layout commands, Steven-g where are you ?

 

; lisp code
("-PLOT" "Y" "" "CLR-PRN03" "A3 (297 x 420 mm)" "m" "LANDSCAPE" "N" "W" "-6,-6" "807,560" "1=2" "C" "y" "DesignlaserCOLOUR.ctb" "Y" "n" "n" "y" "N" "N" "y")
; also -layout set layout1 Zoom E etc

Link to comment
Share on other sites

Yes, I have AutoCAD LT 2011.

 

In response to the other comment it does not have multiple layers. The DWGs I wish to convert to PDF always open up in Layout 1. There are just multiple DWG files I need to open up and convert to PDFs, and the process is very repetitive.

Link to comment
Share on other sites

Yes, I have AutoCAD LT 2011.

 

Then you are relegated to using Scripts & Macros only... LT does not support any other programming interface, such as LISP, VBA, .NET, etc. (only full versions).

 

Cheers

Link to comment
Share on other sites

Something like this

 

open dwg1
-layout set layout1
pspace
zoom e
-PLOT Y plottername A3 m LANDSCAPE N W -6,-6 807,560 1=2  C y Designlaser.ctb Y N N N N N Y
close
open dwg2
and so on

Link to comment
Share on other sites

Thanks for the responses everyone. While the layout that needs printing doesn't change, the names of the drawings vary from site to site (Ex: 876898_A_14-I, 876898_A_29-P, and this is for one site, the 6 digit number changes on each site), so I'm pretty sure I need to take a different approach, or do I? Ha.

 

I'm currently trying to think if there's a way to use the Publish tool for my problem, but it seems pretty picky about where to place the files and which files to select (I'm new to this command). Any suggestions?

Link to comment
Share on other sites

Going back to scripts for a moment a lisp can write a script so you could pick multiple drawings and make a new script, but as you have LT a different approach, you could use excel it has VBA built in so again pick dwg file. Another is to use word make a list of your dwgnames add directory etc have a play with replace using ^p this is the end of line and you can put stuff before and after add multi lines all sorts of things very quickly. Try on a simple dwg list replace ^p ^pOpen, replace ^p ^p-layout set layout1^p

Link to comment
Share on other sites

Printing a PDF of a drawing can be easily achieved with a script, much like BIGAL has outlined. It will save a PDF of the same file name in the same location.

 

Then you can create a batch file that can run on every file in a folder.

 

This will be the best approach for LT. Well worth the time learning how to do it.

 

The batch file will loop through each file in the specified folder and perform the following:

open AutoCAD, open the file, run the script file (in which you print the pdf), close AutoCAD.

 

Script and batch files you can create using Notepad.txt files, and then rename them to .scr and .bat files once they are ready. Surprisingly easy once you know how.

 

I find it easiest to do it one folder at a time, then simply change the paths in the .bat file, and run it again for a different folder. If that wa not powerful enough you could probably work out a way to move them all into a single folder, but it all depends on the scope of this job.

Link to comment
Share on other sites

Does LT not support the Autopublish mechanism?

 

I use this to produce PDF of drawing at *SAVE* per named Page Setup; no manual plot or publish needed, just do your work and save drawing. Lemon squeezy.

 

Cheers

Link to comment
Share on other sites

This will be the best approach for LT. Well worth the time learning how to do it.

 

The power of excel it has a full programming language built in so many tasks can be automated get excel to write the script, it is not really that hard. Think outside the square.

 

Scripts can be so powerful its a case of working with what you have. Give a man a bigger hammer he can hit it harder but will the soft approach not damage it.

Link to comment
Share on other sites

Wow, thanks again everyone. This forum has proved to be very helpful so far. I'll follow up and try to teach myself the methods everyone has previously laid out and will let you know how it goes.

Link to comment
Share on other sites

Does LT not support the Autopublish mechanism?

 

I use this to produce PDF of drawing at *SAVE* per named Page Setup; no manual plot or publish needed, just do your work and save drawing. Lemon squeezy.

 

Cheers

 

It seems LT has Autopublish. I have never actually used it. Interesting thought.

 

I'll follow up and try to teach myself the methods everyone has previously laid out and will let you know how it goes.

 

You're welcome. Send through any specific questions if you hit any walls. Someone will be able to solve it for you.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...