Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vba plotting 1

Status
Not open for further replies.

msstrang

Programmer
Sep 19, 2005
62
US
hey all!!!

i've gotten very far into a vba program i am currently writing.

so far it does the following steps;

1. connects to my ftp site
2. logs onto my ftp site
3. goes to the specified folder on my ftp site
4. searches the folder for a specific pdf.
5. returns whether or not the pdf file exists
6. *see below for why i need help with this step
7. if the .pdf file is in the ftp folder it replaces the old pdf with the new pdf.

*
i cannot figure out how to code in vba to create a pdf of an autocad drawing. does anyone have any suggestions. any help is GREATLY appreciated.
 
Hi msstrang,

I've never used a PDF publisher but isn't it just a plot driver? If it is, just use the plottodevice method.

HTH
Todd
 
ok, i had a feeling that was what i needed to do. thanks.
but i am having trouble setting up the configurations to select printer, extents, page layout, etc.
 
Hi msstrang,

You'll need to use two different objects, the AcadLayout, and AcadPlot objects, here's a chunk out of a batch plot routine I wrote years ago, just to give you an idea of how you'll need to set up your configurations etc:
Code:
...
 With AcadDoc
    With .ActiveLayout
      .ConfigName = rstFiles("PlotDevice").Value
      .StyleSheet = rstFiles("PlotStyleTable").Value
      .PaperUnits = rstFiles("PaperUnits").Value
      .CanonicalMediaName = rstFiles("MediaName").Value
      .PlotType = rstFiles("PlotType").Value
      .PlotRotation = rstFiles("PlotRotation").Value
      .PlotOrigin = rstFiles("PlotOrigin").Value
      .CenterPlot = rstFiles("CenterPlot").Value
      .UseStandardScale = rstFiles("UseStandardScale").Value
      .StandardScale = rstFiles("Scale").Value
      .ScaleLineweights = rstFiles("ScaleLineweights").Value
      .PlotWithLineweights = rstFiles("PlotWithLineweights").Value
      .PlotWithPlotStyles = rstFiles("PlotWithPlotStyles").Value
      .PlotViewportsFirst = rstFiles("PlotPSpaceLast").Value
      .PlotHidden = rstFiles("PlotHidden").Value
    End With
    With .Plot
      .NumberOfCopies = intNumberOfCopies
      .QuietErrorMode = True
    End With
  End With 
...
..

HTH
Todd
 
todd, you are the man.
thank you so much for getting me on the right track. i've gotten my program one final step further and i have you to thank.

marcus
 
ohhhh....
i have one more question, and then i'm completely done with my code.

does anyone know how to find have VBA find the path and file name of an open pdf and save it to a variable.
i thought this would be simple to figure out, but am having a bit of trouble.

thanks.
 
i've figured out that if i used the ".getinfo" command i can used it to get the creator information, which gives me the path and filename of the file the pdf was created. but i can't use the ".getinfo" command to get the file information of the open .pdf. is there a way this can be done?
 
nevermind, i figured it out.
just in case anyone else has this problem let me clarify what was happenning.

i was trying to upload an open pdf file to my ftp site.
at first i thought to upload the file i would need the path of the pdf as well, but it turns out that I only needed the file name to do this, since the pdf was already open.

thanks again todd for your help, and if anyone has any questions about my project that might help them let me know.

best regards
Marcus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top