DWF plotting

Discussion in 'AutoCAD' started by Frank Jan Koole, Jan 14, 2004.

  1. Hi,

    I have a macro for plotting Modelspace into a dwf-file. And it almost works
    perfectly only plot style table (pen assignments) don't come out the way I
    want.

    Can anyone help me out here?
    Thanks,
    Frank

    Sub DWF()
    Dim objPlot As AcadPlot
    Dim objlayout As AcadLayout
    Dim strNm(0) As String
    Dim varNm As Variant
    Dim strsplit() As String
    Dim strcode As String
    Dim strpath As String
    Dim I As Integer
    Dim K As Integer

    strsplit = Split(ThisDrawing.FullName, VBBSLS)
    Do
    K = K + 1
    Loop Until strsplit(K) = "Objects" Or strsplit(K) = "Types"

    For I = K + 1 To UBound(strsplit)
    strcode = strcode + strsplit(I)
    If Not I = UBound(strsplit) Then strcode = strcode + "."
    Next I

    Set objPlot = ThisDrawing.Plot
    Set objlayout = ThisDrawing.ActiveLayout

    strNm(0) = objlayout.Name
    varNm = strNm

    strpath = "D:\TEMP\DWF"
    strpath = strpath + VBBSLS + strcode
    strpath = Replace(strpath, ".dwg", ".dwf")

    With objlayout
    .StyleSheet = ""
    .StyleSheet = "FRANK.CTB" '<= in this file I configured my
    lineweights
    End With

    With objPlot
    .SetLayoutsToPlot varNm
    .QuietErrorMode = False
    .NumberOfCopies = 1
    .PlotToFile strpath, "DWFMS.pc3"
    End With

    SendCommand "qsave "

    Set objPlot = Nothing
    Set objlayout = Nothing
    Erase strNm
    varNm = Empty

    End Sub
     
    Frank Jan Koole, Jan 14, 2004
    #1
  2. You need to tell it to use plotsyles, Frank:

    With objlayout
    .PlotWithPlotStyles = True
    .StyleSheet = "FRANK.CTB"
    End With
    ___________________________
    Mike Tuersley
    AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jan 14, 2004
    #2
  3. Thank you, Mike, but it doesn't work. All lines in my dwf still have the
    same lineweight and I'm sure that there is a difference specified in my .CTB
    file.

    Any idea what can be wrong?
    Frank
     
    Frank Jan Koole, Jan 15, 2004
    #3
  4. Frank,

    Try adding a .RefreshPlotDeviceInfo after setting your ctb file.

    ___________________________
    Mike Tuersley
    AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jan 15, 2004
    #4
  5. Frank Jan Koole

    Joe Sutphin Guest

    Frank,

    I don't see where you are attaching your .PC3 file to the .ConfigName
    property of the Layout you want plotted.

    Joe
    --
     
    Joe Sutphin, Jan 19, 2004
    #5
  6. Frank Jan Koole

    perry Guest

    Hi Frank,
    Im new to VB stuff and was looking for a routine to plot DWF files with some
    flexibility (specify device, ctb, etc.) and your
    routine looked like it would fit the bill. The code makes sense to me for
    the most part but Im confused by all the "string split"
    stuff in the beginning. After I commented this out it worked just fine.
    Whats all that for?
     
    perry, Jan 20, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.