• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. Accessing color

Stats

  • Replies 5
  • Subscribers 160
  • Views 13968
  • Members are here 0
More Content

Accessing color

JerryWilson
JerryWilson over 7 years ago

Hi Dave

I tried to use a code you provided in one of the forum below in 17.2, i'm seeing errors 

E- *Error* defun: too few arguments (at least 3 expected, 2 given) - (DE_setLayerColour (layer colour))
E- *Error* load: error while loading file - "L:/ecad_proj/MCLLIB_ZMY12_172/cjj082_adwlib/codes/col.il" at line 1

Tried reomoving the ")", seeing the error below. Am I missing something. Please Advice.

E- *Error* DE_setLayerColour: too few arguments (2 expected, 0 given) - nil

defun( DE_setLayerColour (layer, colour))
let((colourNo, colours, n, p)
cond(
(numberp(colour), colourNo = colour)
(!colour, nil)
(t
colours = '(
(White 255 255 255)
(LtBlue 014 210 255)
(Rose 255 121 203)
(Green 000 255 106)
(Purple 166 016 255)
(Teal 121 153 196)
(Red 255 000 000)
(Yellow 255 255 000)
(Blue 000 000 255)
(Aqua 055 247 215)
(Gray 179 179 185)
(Olive 116 196 143)
(Orange 252 199 046)
(Pink 255 178 255)
(Beige 172 138 138)
(Navy 002 168 213)
(Violet 176 000 206)
(Gold 234 190 000)
(Silver 217 224 224)
(Rust 242 127 134)
(Lime 014 249 182)
(Brown 161 004 004)
(Mauve 224 141 202)
(Black 000 000 000)
)
n = listnindex(mapcar(lambda((colDef), lowerCase(car(colDef))), colours), lowerCase(colour))
when(n, colourNo = n + 1, axlColorSet(colourNo, cdr(nth(n, colours))))
)
)
when(colourNo, p = axlLayerGet(layer), p ->color = colourNo, axlSetParam(p))
))

  • Sign in to reply
  • Cancel
  • eDave
    eDave over 7 years ago

    The first line has an extra bracket.

    try replacing it with:

    defun( DE_setLayerColour (layer, colour)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • JerryWilson
    JerryWilson over 7 years ago
    Hi Dave
    I tried that & i'm getting this error. Please advice.
    Thanks
    Jerry

    Skill > load("L:/ecad_proj/MCLLIB_ZMY12_172/cjj082_adwlib/codes/col.il")
    function DE_setLayerColour redefined
    t
    Skill > DE_setLayerColour
    E- *Error* DE_setLayerColour: too few arguments (2 expected, 0 given) - nil
    ERROR
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 7 years ago
    DE_setLayerColour("ETCH/TOP", "Violet")
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • JerryWilson
    JerryWilson over 7 years ago
    Hi Dave
    Do i need to specify the layers & color every time i load the function? How can i load this color setup 1 time & set the color.
    I notice that 17.2 has a default color setup. Can i load the default color setup using skill & setup my colors accordingly. I was thinking of doing that way.
    Please advice.
    Thanks
    Jerry
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 7 years ago
    Hi Jerry,
    This is just an example of what you can do in a function.
    I haven't used 17.2 colours enough to know what's possible but I think using the system features will be your best approach.
    Dave
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information