• 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 Scripting - Skill
  3. Any way in allegro skill to get bBox of all selected objects...

Stats

  • Replies 2
  • Subscribers 18
  • Views 3948
  • Members are here 0
More Content

Any way in allegro skill to get bBox of all selected objects. I goal is to get a bBox which includes all the selected items

Murugesha M S
Murugesha M S over 2 years ago

Any way in allegro skill to get bBox of all selected objects. I goal is to get a bBox which includes all the selected items

  • Cancel
  • Sign in to reply
  • DavidJHutchins
    DavidJHutchins over 2 years ago

    I wrote a simple routine for this, code shown below:

    procedure(GetSelbBox()
        let((bBox llx urx ury lly)
            foreach(obj
                axlGetSelSet()
                if(bBox then
                    when((caar((obj->bBox)) < llx)
                        (llx = caar((obj->bBox)))
                    )
                    when((cadar((obj->bBox)) < lly)
                        (lly = cadar((obj->bBox)))
                    )
                    when((caadr((obj->bBox)) > urx)
                        (urx = caadr((obj->bBox)))
                    )
                    when((cadadr((obj->bBox)) > ury)
                        (ury = cadadr((obj->bBox)))
                    )
                else
                    (bbox = (obj->bbox))
                    (llx = caar((obj->bBox)))
                    (urx = caadr((obj->bBox)))
                    (ury = cadadr((obj->bBox)))
                    (lly = cadar((obj->bBox)))
                )
            )
            (bBox = list((llx:lly) (urx:ury)))
            bBox
        )
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • DavidJHutchins
    DavidJHutchins over 2 years ago in reply to DavidJHutchins

    The code I posted yesterday wasn't exactly correct, please use the code below:

    procedure(GetSelbBox()
    let((bBox llx urx ury lly)
    foreach(obj axlGetSelSet()
    if(bBox then
    when((car(car((obj->bBox))) < llx)
    (llx = car(car((obj->bBox))))
    )
    when((cadr(car((obj->bBox))) < lly)
    (lly = cadr(car((obj->bBox))))
    )
    when((car(cadr((obj->bBox))) > urx)
    (urx = car(cadr((obj->bBox))))
    )
    when((cadr(cadr((obj->bBox))) > ury)
    (ury = cadr(cadr((obj->bBox))))
    )
    else
    (bBox = (obj->bBox))
    (llx = car(car(bBox)))
    (lly = cadr(car(bBox)))
    (urx = car(cadr(bBox)))
    (ury = cadr(cadr(bBox)))
    )
    )
    list((llx:lly) (urx:ury))
    )
    )

    • 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