PDA

View Full Version : Automatic Publish


Robert.Hall
2008-02-27, 05:26 PM
Is there a way to automate publishing a dwf file?
I use the pagesetup manager/publish/sheet list method.

I am going to keep using the exact same sheet list and save every
dwf I publish into C:\dwf

I could use the same name for each sheet list and have them stored
in the same file folder as the drawing file. It may help in a routine based
solution.

Anyone care to take a stab at this one? I am not much of a programmer and
it could be very useful to many users.

Opie
2008-02-27, 06:47 PM
Are there any new sheets added to this Sheet Set? If not, you could create a script file (.scr extension) and add it to a schedule timer for Windows. Just a thought.

rkmcswain
2008-02-27, 07:11 PM
What version of AutoCAD are you using? 2008 and up include the ability to create a DWF file each time you save or close a drawing.

Robert.Hall
2008-02-27, 08:55 PM
I am not using layouts and/or sheet set manager.

I need something that will work with the publish command
and a saved sheet list. (see attached image)


I should have the ability to call upon the publish command, automatically populate the sheet list, and save the dwf file in a default directory.

I just do not have the background to pull it off.

Robert.Hall
2008-02-29, 07:06 PM
Ive got the sequence down.

1. Publish command
2. Load sheet list (sheetlist.dsd) from same
directory as drawing file
3. publish to C:\dwf as file named publish.dwf

I can keep uploading sheet lists and rewritting
publish.dwf

Anyone know how to put this together?

dxarhoulakos
2008-02-29, 10:30 PM
Ive got the sequence down.

1. Publish command
2. Load sheet list (sheetlist.dsd) from same
directory as drawing file
3. publish to C:\dwf as file named publish.dwf

I can keep uploading sheet lists and rewritting
publish.dwf

Anyone know how to put this together?

I agree with RK. The knew automatic DWF feature in 2008 is wonderful. What version are you using?

Robert.Hall
2008-03-03, 03:45 PM
I agree with RK. The knew automatic DWF feature in 2008 is wonderful. What version are you using?

Yes, if the user has layouts.
My office will not use layouts.

jmctamney
2008-03-03, 04:03 PM
Yes, if the user has layouts.
My office will not use layouts.

If I'm understanding this correctly you already have the .dst file saved with all the info you need for creating your .dwf's and your just looking for a way to automate the process with a script or lisp. If this is the case you could try this:


filedia
0
-publish
c:\projects\your.dsd (add your info here)
filedia
1


Just copy it to note pad and save it with a .scr extension.

rkmcswain
2008-03-03, 04:39 PM
Yes, if the user has layouts.
My office will not use layouts.

Not exactly true.
AutoPublish works with MS too.

Robert.Hall
2008-03-03, 10:14 PM
If I'm understanding this correctly you already have the .dst file saved with all the info you need for creating your .dwf's and your just looking for a way to automate the process with a script or lisp. If this is the case you could try this:


filedia
0
-publish
c:\projects\your.dsd (add your info here)
filedia
1


Just copy it to note pad and save it with a .scr extension.

Bingo. There should be a way to call the file dwf.dsd and have
the location derived from the current drawing directory.
A lisp routine could populate the .dsd target somehow.

jmctamney
2008-03-03, 10:31 PM
Bingo. There should be a way to call the file dwf.dsd and have
the location derived from the current drawing directory.
A lisp routine could populate the .dsd target somehow.

So your wanting something that will read your drawing directory and create a sheet list from the contents of said drawing directory, set the save location to the same directory, save the .dst file as dwf.dst and then publish.

That should be easy...........for someone who knows what he's doing. Unfortunately that one goes way beyond my realm of programming.

Robert.Hall
2008-03-04, 03:29 PM
So your wanting something that will read your drawing directory, use a predefined sheet list (dwf.dst) from the contents of said drawing directory, and publish a dwf to C:\DWF.

That should be easy...........for someone who knows what he's doing. Unfortunately that one goes way beyond my realm of programming.

More like the above.

jmctamney
2008-03-04, 03:44 PM
Originally Posted by jmctamney http://forums.augi.com/images/buttons/viewpost.gif (http://forums.augi.com/showthread.php?p=817983#post817983)
So your wanting something that will read your drawing directory, use a predefined sheet list (dwf.dst) from the contents of said drawing directory, and publish a dwf to C:\DWF.

That should be easy...........for someone who knows what he's doing. Unfortunately that one goes way beyond my realm of programming.


More like the above.

Ok, I a little confused now. Why read the directory if the sheet list is already set up? The .dst file will have all relavent information in it. If you already have it set up for the drawings and save locations, what are you trying to automate?

Robert.Hall
2008-03-04, 06:21 PM
Each project has its own sheet list containing X number of pages.

Using the same naming convention and
saving the files in the current drawing directory may make this easy to do in lisp.

jmctamney
2008-03-04, 06:25 PM
Each project has its own sheet list containing X number of pages.

Using the same naming convention and
saving the files in the current drawing directory may make this easy to do in lisp.

So you want a .dst file with predetermined page setup and save location information and the drawing list portion of it populated by the contents of the drawing directory in which it resides?

I'm still confused... maybe it's the wording because you can't have a sheet list before it's populated by the drawing directory.

Maybe you could look at using the SSM. There are a lot of publish tools I think it might have everything your looking for.

rkmcswain
2008-03-04, 07:21 PM
Maybe you could look at using the SSM.

That is what I'm thinking.

I am not using layouts and/or sheet set manager.

At first you say you are not using layouts or SSM, but in some recent posts, there has been discussion of .DST files - which are SSM files.

jmctamney
2008-03-04, 09:07 PM
That is what I'm thinking.



At first you say you are not using layouts or SSM, but in some recent posts, there has been discussion of .DST files - which are SSM files.

Thats my fault. I had a typo. He was talking about the publish sheet list (.DSD). I accidentally typed .dst and never caught it

Robert.Hall
2008-03-07, 03:32 PM
Yes, we meant to say .dsd

That is what a routine will need.

Any takers?

jmctamney
2008-03-07, 03:51 PM
Now that we have that cleared up I go back to my original question. If you already have a .DSD file what is the point. Unless you are looking for something to create the .DSD file using predetermined values for name and save locations for the .DWF file and then populate the list with the contents of the directory.

Robert.Hall
2008-03-07, 08:10 PM
I want to have a quick way to publish a DSD file so that when a user says "Doh! I forgot something", it is relatively quick to make the change and republish the DWF.

Click a toobar button and whammo, get another DWF!

Mike.Perry
2008-03-13, 09:36 AM
Hi Robert

Done! Thread moved from the AutoCAD Customization (http://forums.augi.com/forumdisplay.php?f=118) forum to this one at your request.

:beer: Mike

Robert.Hall
2008-03-13, 02:41 PM
I need a lisp routine that does the following:

1. Reads current drawing directory
2. grabs a predefined sheet list named "dwf.dsd" from the contents
of said drawing directory
3. Publishes a dwf to C:\DWF.

Can someone help me out?

ccowgill
2008-03-13, 07:27 PM
I need a lisp routine that does the following:

1. Reads current drawing directory
2. grabs a predefined sheet list named "dwf.dsd" from the contents
of said drawing directory
3. Publishes a dwf to C:\DWF.

Can someone help me out?

everyone on the planet is probably going to be faster than me on this one...
it is easy to do, I'll be back soon with a solution


(defun c:qpublish (/ path1 ss)
(setvar "filedia" 0)
(setq path1 (getvar "dwgprefix")
ss (strcat path1 "dwf.dsd")
) ;_ end of setq
(if (/= ss nil)
(command "-publish" ss)
)
(setvar "filedia" 1)
) ;_ end of defun

I have not been able to test the above code, I dont have any good examples to test it on, you can give it a shot and see how it does.

Robert.Hall
2008-03-13, 10:57 PM
That is so awesome.
Works like a charm :lol:

:beer: for you!

Robert.Hall
2008-03-14, 03:37 PM
Adding a random thought to this...........

Can the routine open the dwf after publishing?

rkmcswain
2008-03-14, 04:00 PM
Can the routine open the dwf after publishing?

Using a variation of this:

http://rkmcswain.blogspot.com/2005/11/launch-pdf-from-autocad.html
(http://rkmcswain.blogspot.com/2005/11/launch-pdf-from-autocad.html)


(defun C:LaunchDWF (/ shell)
(vl-load-com)
(setq filename "C:\\MyDwfs\\sample.dwf")
(setq shell
(vla-getinterfaceobject
(vlax-get-acad-object)
"Shell.Application"
)
)
(vlax-invoke-method shell 'Open filename)
(vlax-release-object shell)
)


Carve up and wedge in as needed.