Results 1 to 6 of 6

Thread: Any way to automate conversion of 200+ drawings from CTB to STB?

  1. #1
    Member
    Join Date
    2000-11
    Posts
    13

    Default Any way to automate conversion of 200+ drawings from CTB to STB?

    We have a project of 200+ drawings that we need to convert from using our CTB file to use our client's STB file. I have been reading and playing with CONVERTCTB, CONVERTPSTYLES, and related commands, but I am not seeing a way to automate this entire conversion with lisp or scripts.

    Does anyone have any experience or tips in this area?

    Thanks in advance.

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    6,836

    Default Re: Any way to automate conversion of 200+ drawings from CTB to STB?

    What are some of the things you have had to do already? Are you just needing to change from CTB to STB? CONVERTPSTYLES adjusts the PSTYLEMODE system variable to 0 (STB) or 1 (CTB). You can check this variable with the following code which checks to see if it is already set to 1. If it is set to 1, then the CONVERTPSTYLES command is run to convert it to 0.
    Code:
    (if (= (getvar "PSTYLEMODE") 1)
      (command "CONVERTPSTYLES")
    )
    There may be additional code needed to make this satisfactory to your needs.

    HTH
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Member
    Join Date
    2000-11
    Posts
    13

    Cool Re: Any way to automate conversion of 200+ drawings from CTB to STB?

    Thanks for the reply Opie. I know all of our drawings are currently set for CTB, PSTYLEMODE=1. I am in planning stages at this point trying to determine the easiest way to process these drawings. Here is what I think needs to happen and would love to automate as much as possible:

    1. I already have the STB from the client which contains a NORMAL style (no screening) and other named styles with varying screen percentages.

    2. To get each drawing to use STB instead of CTB, do I have to run the CONVERTPSTYLES within each and every drawing, which requires me to select the same CTB and rebuild the same STB repeatedly? If so, I'm not sure I can do that via a script!

    3. Next I would need to import a predefined page setup that uses the client's STB and reset the current page setup in each drawing.

    4. Since layer colors are no longer an issue, I need to write and run a script or use LAYTRANS to assign lineweights and named plot styles to each layer name in all drawings. The script could be run across the entire set with ScriptPro.

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    6,836

    Default Re: Any way to automate conversion of 200+ drawings from CTB to STB?

    Quote Originally Posted by kjbusacker
    Thanks for the reply Opie. I know all of our drawings are currently set for CTB, PSTYLEMODE=1. I am in planning stages at this point trying to determine the easiest way to process these drawings. Here is what I think needs to happen and would love to automate as much as possible:

    1. I already have the STB from the client which contains a NORMAL style (no screening) and other named styles with varying screen percentages.

    2. To get each drawing to use STB instead of CTB, do I have to run the CONVERTPSTYLES within each and every drawing, which requires me to select the same CTB and rebuild the same STB repeatedly? If so, I'm not sure I can do that via a script!

    3. Next I would need to import a predefined page setup that uses the client's STB and reset the current page setup in each drawing.

    4. Since layer colors are no longer an issue, I need to write and run a script or use LAYTRANS to assign lineweights and named plot styles to each layer name in all drawings. The script could be run across the entire set with ScriptPro.
    I would still test the variable in case the script runs across a file that has the correct plot style type.

    1. No comment necessary.

    2. I believe you need to run the CONVERTPSTYLES command in each drawing. This does not require you to rebuild any CTB / STB conversions. That is the CONVERTCTB command.

    3. See if this post, "Import Page Setups - with certain caveats" will help you. You may want to read the rest of the thread as well. The routine mentioned could be added to the script you plan on running with ScriptPro.

    4. That is correct.

    I am not certain that ScriptPro works with 2007.

    Good Luck.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    2,291

    Default Re: Any way to automate conversion of 200+ drawings from CTB to STB?

    Quote Originally Posted by kjbusacker
    ...

    4. Since layer colors are no longer an issue, I need to write and run a script or use LAYTRANS to assign lineweights and named plot styles to each layer name in all drawings. The script could be run across the entire set with ScriptPro.
    Doesn't convertpstyles from ctb to stb assign a plot style to layers based on your predetermined color's lineweight? I don't know about automating it, but I think by just running the convertpstyles and selecting the same stb, it assigns plotstyles to layers.
    I've run into this on an individual dwg basis, If I have drawings that need to to be set to stb, I run the convertpstyles command and it assigns the plotstyles. Then if for some reason a new layer gets introduced, you run it again (back to ctb then to stb) it fixes the new layers. This is assuming you have predetermined ctb and stb files.

    That's my take on it.
    Ted
    ____________________________________________________________________________________
    AutoCAD 2012 - REVIT Structure 2012 - MicroStation V8i - Windows 7 Professional - (dabble with Inventor 2012)

  6. #6
    Member
    Join Date
    2008-07
    Posts
    5

    Default Re: Any way to automate conversion of 200+ drawings from CTB to STB?

    Can someone help me finish this lisp? It loads, but I'm still set to CTB....


    (defun CPS (if (= (getvar "PSTYLEMODE") 1)
    (command "CONVERTPSTYLES")
    )
    )
    (CPS "C:\\_AutoCAD\\2013\\Config\\Plot Style (STB)\\acadstandard.stb")


    or

    (if (= (getvar "PSTYLEMODE") 1)
    (command "CONVERTPSTYLES" "C:\\_AutoCAD\\2013\\Config\\Plot Style (STB)\\acadstandard.stb")
    )


    Any help would be appreceated... I just have to load this into my master lisp for everyone.... Much Thanks!!

Similar Threads

  1. Replies: 5
    Last Post: 2011-01-27, 09:58 PM
  2. Trying to automate layer tagging.
    By jmccracken.202999 in forum AutoCAD Customization
    Replies: 1
    Last Post: 2008-12-09, 11:55 AM
  3. Can I automate this at all?
    By kari_san in forum AutoLISP
    Replies: 0
    Last Post: 2007-10-30, 09:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •