• 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 - TCL
  3. Menu "Place::Line" Use a free style

Stats

  • State Not Answered
  • Replies 2
  • Subscribers 13
  • Views 252
  • Members are here 0
More Content

Menu "Place::Line" Use a free style

ZH202409115233
ZH202409115233 1 day ago

I want to use TCL to implement a Menu "Place::Line". It should allow me to use my selected Line Style, Line Width, and Color to freely draw lines, rectangles, and annotations with the mouse. However, I currently have no idea how to implement this. Could you please suggest some good methods?

  • Sign in to reply
  • Cancel
  • CadAP
    0 CadAP 21 hours ago

    ZH202409115233 

    Please see the sample scrip how I am drawing a line from the lst click of the mouse and changing the size and color.

    roc capEnabler {} {

    return 1
    }

    proc capDrawline {} {

    set lMouseClick [GetLastMouseClickPointOnPage]
    set lX2 [expr [lindex $lMouseClick 0] + 30.00]
    set lY2 [lindex $lMouseClick 1]
    # puts $lMouseClick
    PlaceLine [lindex $lMouseClick 0] [lindex $lMouseClick 1] $lX2 $lY2
    SetLineWidth 2
    SetColor 8

    }

    RegisterAction "DrawLine" "capEnabler" "Ctrl+R" "capDrawline" "Schematic"

    Similar you can do for other shapes.

    Hope it will help to proceed further.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ZH202409115233
    0 ZH202409115233 21 hours ago in reply to CadAP

    Thank you. I understand the usage of this code, but I want to set the style first. Then, I can control the head and tail with the mouse as in the standard function on the interface. Right-click "done" to cancel. Is there any way to do this?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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