• 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. SKILL function question

Stats

  • Replies 2
  • Subscribers 159
  • Views 12648
  • Members are here 0
More Content

SKILL function question

chads108
chads108 over 12 years ago

I am a beginner at best in SKILL, but I am trying to modify an existing routine.  Here is the part of routine I am working on.  Previously, I filled in a Radius in a form, but I would like to modify the routine so that Radius is 20% of Height, with a maximum Radius of 0.25 and a minimum of 0.01.  The text in bold is what I started, but like I said, I don't really know what I am doing.  I am sure this is an easy fix.  Can one of you experts show me the correxct way to handle this please.

(defun _ns_spad_outform_run ()
    let((Length Height Radius ls1 ls2 ls3 ls4 ls5 ls6 ls7 ls8 ls9 pad_path)

        Length   = axlFormGetField( _ns_spad_outform "boxx")
        Height   = axlFormGetField( _ns_spad_outform "boxy")
;        Radius  = axlFormGetField( _ns_spad_outform "radius")
    (  if ( (Height > 1.25) then Radius = .25
      else
    Radius = Height*.2)
     )

 

Thanks.

Chad

  • Sign in to reply
  • Cancel
  • eDave
    eDave over 12 years ago
    Radius = max(min(Height * 0.2, 0.25), 0.01)
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • chads108
    chads108 over 12 years ago

    Thank you Dave.  That worked perfectly.  I figured I was over thinking it.

    • 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