• 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. Force axlDBCreateShape() to not define a shape as a rectangle...

Stats

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

Force axlDBCreateShape() to not define a shape as a rectangle?

mstaub
mstaub over 4 years ago

Does anyone know a way to force the function axlDBCreateShape() to NOT define a shape as a rectangle when the o_polygon/r_path coordinates just happen to form a rectangle? For example I am using axlDBCreateShape() to create shapes in a design. In instances where the shape is rectangular, this function now defines the shape as a rectangle (as seen using shape->isRect or 'FILLED RECTANGLE' when using show element). When I draw this exact same shape using "Shape Add", the shape is always defined as a shape (nil for shape->isRect or 'SHAPE' when using show element).

The reason I don't want it to be defined as a rectangle is because I am later trying to modify the shape using axlDBOpenShape(). If the new shape outline is not a rectangle, this function won't modify the shape outline and return nil.

  • Cancel
  • Sign in to reply
Parents
  • mstaub
    mstaub over 4 years ago

    ...And 10 minutes after posting this I found the solution.

    When looking at the documentation for axlDBCreateCloseShape(o_shape [g_forceShape]) I noticed it had the following parameter and description:

    g_forceShape

    By default, Allegro creates a rectangle in its database when an outline is a rectangle. This is for performance and space reasons. To override this behavior, pass the argument value as t when closing a shape.

    My guess is that since axlDBCreateShape()  is essentially a wrapper for axlDBCreateOpenShape() and axlDBCreateCloseShape() with no way to set g_forceShape, it's causing my shapes to be defined as rectangles. I have since changed my code to use axlDBCreateOpenShape() and axlDBCreateCloseShape() and set g_forceShape to 't' rather than using axlDBCreateShape() and everything is working as expected now!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Grungy Remnant
    Grungy Remnant over 4 years ago in reply to mstaub

    Thanks for the solution update.  I was having the same issue. :)

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Grungy Remnant
    Grungy Remnant over 4 years ago in reply to mstaub

    Thanks for the solution update.  I was having the same issue. :)

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
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