• 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. Custom IC SKILL
  3. Skill code for aligning any shape or instance at the midpoint...

Stats

  • Replies 0
  • Subscribers 143
  • Views 45
  • Members are here 0

Skill code for aligning any shape or instance at the midpoint of the ruler.

yogeshjaiswalCAD
yogeshjaiswalCAD 3 hours ago

Greetings Team,

Thanks for always being there for help. I need help with the skill code for aligning any shape or instance at the midpoint of the ruler in Virtuoso Layout Editor. 

I have shared the concept reference. 

; that depend on the exact view and object you're working with.

; 1. Get the selected object's bounding box
object_bBox = selected_object~>bBox

; 2. Calculate the object's center
object_mid_x = (car(object_bBox) + cadr(object_bBox)) / 2
object_mid_y = (cadr(object_bBox) + caddr(object_bBox)) / 2
object_mid_point = list(object_mid_x object_mid_y)

; 3. Define the target ruler midpoint (this part is highly dependent on your setup)
; For example, if you want to center it in the current view's X-dimension
cv = geGetEditCellView()
view_bBox = cv~>bBox
ruler_mid_point_x = (car(view_bBox) + cadr(view_bBox)) / 2
ruler_mid_point_y = (cadr(view_bBox) + caddr(view_bBox)) / 2 ; Or a specific ruler Y

; 4. Calculate the displacement needed to move the object's center to the ruler's midpoint
dx = ruler_mid_point_x - object_mid_point~>x
dy = ruler_mid_point_y - object_mid_point~>y

; 5. Move the object using a movement function (replace with actual function like leMoveFig)
; You'll need to select the object and then call a function to move it by (dx, dy)
; Example: leMoveFig(list(selected_object) list(dx dy) nil) ; Incorrect syntax for illustration

Please share with me any skill code for aligning any shape/instance at the midpoint of the ruler.
I will be grateful for your help. Please help in!

With warm regards,

Yogesh Jaiswal

  • Sign in to reply
  • Cancel

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