Layer Color and Named Plot Style Assignments...?

Discussion in 'AutoCAD' started by John Herridge, AIA, Nov 9, 2004.

  1. Is it possible to develop a VBA program for this purpose?

    Example:
    Color Name Plot Style Name
    Red Fine
    Green Medium
    Yellow Wide
    etc.

    If so, what would be the major parts of the program to consider?
     
    John Herridge, AIA, Nov 9, 2004
    #1
  2. Hi John,

    What is the purpose of the program?
    You have simply listed a set of possible properties of drafted objects.

    Do you want to create these properties ? - You can't

    Do you want to change them for drawing objects? - You can, but is it for:
    All objects?
    Some object? - If some:
    Do you want the user to select them?
    Do you want the program to select them?

    Do you want to assign them to objects your program draws ? - You can.
    etc.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Nov 9, 2004
    #2
  3. Laurie,
    Please let me clarify what I am seeking...

    When converting existing CTB drawing files to STB, the pen style assignments
    don't always cross over correctly for pen style assignments. The layer
    color / pen style assignment would be a fixed list.
    Therefore, I am looking for ways to hack the layer table to assign existing
    named pen styles (STB) to existing layers based upon the color properties of
    those layers.

    The only thing that varies would be the layer names and the drawing file
    name being processed. A utility that runs in unattended mode would be a
    plus.

    Thanks for responding!
    John
     
    John Herridge, AIA, Nov 10, 2004
    #3
  4. Hi Jon,

    In general you can loop through all the layers in a drawing.

    Sub ChangeLayerProperties
    Dim oLayer as AcadLayer
    For each oLayer in ThisDrawing.Layers
    ProcessLayer oLayer
    Next

    End Sub
    Function ProcessLayer (oLayer as AcadLayer)
    Select Case oLayer.Color
    Case 1
    oLayer.Property = whatever
    Case 2
    oLayer.Property = something else

    etc.
    End Select

    End Function

    As I don't know anything about plotting you will have to look at the Layer
    Properties which you can set to see if they meet your requirements.

    One which is included is PlotStyleName.

    Also note this code is only there to establish process. It won't work as
    is.

    --

    Regards,


    Laurie Comerford
    www.cadapps.com.au
     
    Laurie Comerford, Nov 10, 2004
    #4
  5. Thanks Laurie!

     
    John Herridge, AIA, Nov 11, 2004
    #5
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.