• 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. PCB Design
  3. Cadence TCL: How to get user input

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 167
  • Views 14691
  • Members are here 0
More Content
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cadence TCL: How to get user input

Jason Stubbs
Jason Stubbs over 10 years ago

I would like to ask the user for a text input to use in my tcl script.

I have tried gets stdin, but the command window returns an error: channel "stdin" wasn't opened for reading.  How do I open the stdin channel?

Is it possible to launch a dialog window to prompt the user instead? Something like this:

  • Cancel
  • oldmouldy
    oldmouldy over 10 years ago
    Tk is the easiest way, take a look at the capPdfLaunch.tcl source to see how this utility uses the grid layout to display a form and get the values from it to control the utility when the user accepts the form, you could take the form design and supporting activity handling directly from the utility to get started and testing, then dump anything unnecessary later once debugged. You could also take a look at the capCustomSamples\HTMLSamples to see how to get input from an HTML form, you would probably need to have a very good reason to use this over the Tk method since the "wiring up" is somewhat more involved due the interaction with the "local web server service" to render the form and get the "post"ed results.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Jason Stubbs
    Jason Stubbs over 10 years ago

    OldMouldy,  thanks for the info.  I've been busy on project work for a couple of months. Finally getting a few free moments to look at this again.  I am an absolute beginner on the Cadence TCL stuff and I have to admit that I cannot understand how the capPdfLaunch.tcl source works! For the single variable user input that I need, I think the grid form is overly complex (for me to understand!).  

    Is there a way to pass a variable through the command window? Either by setting a variable value before running the script or by passing it as a parameter?

    I can see that I am still a long way off from having this as an integrated part of our setup!

    • Cancel
    • Vote Up 0 Vote Down
    • 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