How to convert CTB drawing to STB?

Discussion in 'AutoCAD' started by lsaapedd, Aug 17, 2004.

  1. lsaapedd

    lsaapedd Guest

    Autocad Mechanical 2005 (Inventor Series 9) on Win2k, SP 4.

    I use stb's for plotting, but everyone else still uses ctb's. I know I can create a new stb from the ctb used in a drawing, but thats dumb. What I want is to switch a ctb drawing to the stb I normally use, not some new stb created by convertctb. Is there a way?
     
    lsaapedd, Aug 17, 2004
    #1
  2. lsaapedd

    The Real JD Guest

    You can start a blank drawing setup with the stb you use and insert the
    other drawing, & explode. It's not a pretty way to to it, but it works.
     
    The Real JD, Aug 17, 2004
    #2
  3. lsaapedd

    Don Butler Guest

    This is something I was playing with. This is not a finished product, but it
    will convert my sample file.

    (defun c:plotColorToNamed (/ style stylefind style2 stylefind2
    apppreferences output files PrinterStyleSheetPath PrinterSearch)
    (if (= (getvar "PSTYLEMODE") 1)
    (progn
    (alert
    (strcat
    "This program will convert Color Dependent\n"
    "PlotStyle Table to Named.\n"
    "\nCTB file MUST be in Support Path\n"
    "\nPlease be patient..."
    )
    )

    (setq style (vla-get-stylesheet (vla-get-activelayout
    (vla-get-activedocument (vlax-get-acad-object)))))
    (setq PlotStylePath (strcat (vla-get-PrinterStyleSheetPath
    (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) "\\"))
    (setq stylefind (findfile (strcat PlotStylePath style)))
    (setq style2 (strcat (vl-filename-base style) ".stb"))
    (setq stylefind2 (findfile (strcat PlotStylePath style2)))
    (setq apppreferences (vla-get-preferences (vlax-get-acad-object)))
    (setq output (vla-get-output apppreferences))
    (setq files (vla-get-files apppreferences))
    (setq PrinterStyleSheetPath (strcat (vla-get-printerstylesheetpath files)
    "\\"))
    (setq PrinterSearch (strcat PrinterStyleSheetPath style2))

    (if (and stylefind stylefind2)
    (progn
    (if (and (= (getvar "tilemode") 0)(= (getvar "cvport") 1))(command
    "Mspace"))
    (command ".convertctb" stylefind "")
    (if (not (findfile printersearch))(vl-file-copy stylefind2 PrinterSearch))
    (alert "Files found!...")
    (command ".convertpstyles" style2)
    (alert "Tables converted!")
    )
    (alert
    (strcat
    "You MUST convert the CTB file with CONVERTCTB first.\n\n"
    "Make sure files are in AutoCAD search path...\n\n"
    (strcat (vla-get-PrinterStyleSheetPath (vla-get-files
    (vla-get-preferences (vlax-get-acad-object)))) "\\")
    )
    )
    )
    )
    (alert "Drawing is already in Name PlotStyle mode!")
    )
    (princ)
    )

    Don


    can create a new stb from the ctb used in a drawing, but thats dumb. What I
    want is to switch a ctb drawing to the stb I normally use, not some new stb
    created by convertctb. Is there a way?
     
    Don Butler, Aug 17, 2004
    #3
  4. lsaapedd

    lsaapedd Guest

    Yeah, I do that. I was hoping for a way to just point and click it. Autodesk's method sucks. I have a stb created from our standard ctb which I can select, then reselect my standard stb, but I don't like that technique either.
     
    lsaapedd, Aug 17, 2004
    #4
  5. lsaapedd

    Jerry Guest

    I don't follow lisp very well and this looks to me like it's basically
    convertctb. Besides, it's not what I'm looking for. I don't see the need.
    Why can't I just load a ctb drawing, click on plot, and select my stb?
    Autodesk? At the worst, all I should have to do then is go to layer manager
    and reset all the plot settings to my standard in the stb.

    Jerry

    By the way, Don,
    I'll give this a try tomorrow at work. Maybe it does more of what I need
    than I can see.

    | This is something I was playing with. This is not a finished product, but
    it
    | will convert my sample file.
    |
    | (defun c:plotColorToNamed (/ style stylefind style2 stylefind2
    | apppreferences output files PrinterStyleSheetPath PrinterSearch)
    | (if (= (getvar "PSTYLEMODE") 1)
    | (progn
    | (alert
    | (strcat
    | "This program will convert Color Dependent\n"
    | "PlotStyle Table to Named.\n"
    | "\nCTB file MUST be in Support Path\n"
    | "\nPlease be patient..."
    | )
    | )
    |
    | (setq style (vla-get-stylesheet (vla-get-activelayout
    | (vla-get-activedocument (vlax-get-acad-object)))))
    | (setq PlotStylePath (strcat (vla-get-PrinterStyleSheetPath
    | (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) "\\"))
    | (setq stylefind (findfile (strcat PlotStylePath style)))
    | (setq style2 (strcat (vl-filename-base style) ".stb"))
    | (setq stylefind2 (findfile (strcat PlotStylePath style2)))
    | (setq apppreferences (vla-get-preferences (vlax-get-acad-object)))
    | (setq output (vla-get-output apppreferences))
    | (setq files (vla-get-files apppreferences))
    | (setq PrinterStyleSheetPath (strcat (vla-get-printerstylesheetpath files)
    | "\\"))
    | (setq PrinterSearch (strcat PrinterStyleSheetPath style2))
    |
    | (if (and stylefind stylefind2)
    | (progn
    | (if (and (= (getvar "tilemode") 0)(= (getvar "cvport") 1))(command
    | "Mspace"))
    | (command ".convertctb" stylefind "")
    | (if (not (findfile printersearch))(vl-file-copy stylefind2
    PrinterSearch))
    | (alert "Files found!...")
    | (command ".convertpstyles" style2)
    | (alert "Tables converted!")
    | )
    | (alert
    | (strcat
    | "You MUST convert the CTB file with CONVERTCTB first.\n\n"
    | "Make sure files are in AutoCAD search path...\n\n"
    | (strcat (vla-get-PrinterStyleSheetPath (vla-get-files
    | (vla-get-preferences (vlax-get-acad-object)))) "\\")
    | )
    | )
    | )
    | )
    | (alert "Drawing is already in Name PlotStyle mode!")
    | )
    | (princ)
    | )
    |
    | Don
    |
    |
    | | > Autocad Mechanical 2005 (Inventor Series 9) on Win2k, SP 4.
    | >
    | > I use stb's for plotting, but everyone else still uses ctb's. I know I
    | can create a new stb from the ctb used in a drawing, but thats dumb. What
    I
    | want is to switch a ctb drawing to the stb I normally use, not some new
    stb
    | created by convertctb. Is there a way?
    |
    |
    | ---
    | Outgoing mail is certified Virus Free.
    | Checked by AVG anti-virus system (http://www.grisoft.com).
    | Version: 6.0.738 / Virus Database: 492 - Release Date: 8/16/2004
    |
    |
     
    Jerry, Aug 18, 2004
    #5
  6. Jerry,

    You need to have an STB that can do the conversion from color-based to
    name-based styles. Once you have that file, you can use it anywhere to do
    the conversion to STB and then change the STB if desired to your real one.
    There is no need to continually create a color-mapped STB.

    I have attached my "converting" STB and my "normal" STB from our Plot Style
    folder as an example. I have this code located in my .mnl file:

    (if (= 1 (getvar "PStyleMode")) ; if in CBT mode
    (command "._ConvertPStyles" "Convert Old MW Drawings.stb")) ; convert to
    named styles


    --
    R. Robert Bell


    I don't follow lisp very well and this looks to me like it's basically
    convertctb. Besides, it's not what I'm looking for. I don't see the need.
    Why can't I just load a ctb drawing, click on plot, and select my stb?
    Autodesk? At the worst, all I should have to do then is go to layer manager
    and reset all the plot settings to my standard in the stb.

    Jerry

    By the way, Don,
    I'll give this a try tomorrow at work. Maybe it does more of what I need
    than I can see.

    | This is something I was playing with. This is not a finished product, but
    it
    | will convert my sample file.
    |
    | (defun c:plotColorToNamed (/ style stylefind style2 stylefind2
    | apppreferences output files PrinterStyleSheetPath PrinterSearch)
    | (if (= (getvar "PSTYLEMODE") 1)
    | (progn
    | (alert
    | (strcat
    | "This program will convert Color Dependent\n"
    | "PlotStyle Table to Named.\n"
    | "\nCTB file MUST be in Support Path\n"
    | "\nPlease be patient..."
    | )
    | )
    |
    | (setq style (vla-get-stylesheet (vla-get-activelayout
    | (vla-get-activedocument (vlax-get-acad-object)))))
    | (setq PlotStylePath (strcat (vla-get-PrinterStyleSheetPath
    | (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) "\\"))
    | (setq stylefind (findfile (strcat PlotStylePath style)))
    | (setq style2 (strcat (vl-filename-base style) ".stb"))
    | (setq stylefind2 (findfile (strcat PlotStylePath style2)))
    | (setq apppreferences (vla-get-preferences (vlax-get-acad-object)))
    | (setq output (vla-get-output apppreferences))
    | (setq files (vla-get-files apppreferences))
    | (setq PrinterStyleSheetPath (strcat (vla-get-printerstylesheetpath files)
    | "\\"))
    | (setq PrinterSearch (strcat PrinterStyleSheetPath style2))
    |
    | (if (and stylefind stylefind2)
    | (progn
    | (if (and (= (getvar "tilemode") 0)(= (getvar "cvport") 1))(command
    | "Mspace"))
    | (command ".convertctb" stylefind "")
    | (if (not (findfile printersearch))(vl-file-copy stylefind2
    PrinterSearch))
    | (alert "Files found!...")
    | (command ".convertpstyles" style2)
    | (alert "Tables converted!")
    | )
    | (alert
    | (strcat
    | "You MUST convert the CTB file with CONVERTCTB first.\n\n"
    | "Make sure files are in AutoCAD search path...\n\n"
    | (strcat (vla-get-PrinterStyleSheetPath (vla-get-files
    | (vla-get-preferences (vlax-get-acad-object)))) "\\")
    | )
    | )
    | )
    | )
    | (alert "Drawing is already in Name PlotStyle mode!")
    | )
    | (princ)
    | )
    |
    | Don
    |
    |
    | | > Autocad Mechanical 2005 (Inventor Series 9) on Win2k, SP 4.
    | >
    | > I use stb's for plotting, but everyone else still uses ctb's. I know I
    | can create a new stb from the ctb used in a drawing, but thats dumb. What
    I
    | want is to switch a ctb drawing to the stb I normally use, not some new
    stb
    | created by convertctb. Is there a way?
    |
    |
    | ---
    | Outgoing mail is certified Virus Free.
    | Checked by AVG anti-virus system (http://www.grisoft.com).
    | Version: 6.0.738 / Virus Database: 492 - Release Date: 8/16/2004
    |
    |
     
    R. Robert Bell, Aug 18, 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.