• 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. Adding fields to form programmatically

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 11514
  • Members are here 0
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

Adding fields to form programmatically

dragank
dragank over 4 years ago

Hi all.

Is there a way to add string field ("hiCreateStringField") to existing form?

I am trying to do something like:

formFields = plotterForm->fieldList
upToCornerSelection = list()
upToCornerSelection = append1(upToCornerSelection car(formFields))
upToCornerSelection = append1(upToCornerSelection cadr(formFields))
upToCornerSelection = append1(upToCornerSelection caddr(formFields))
afterCornerSelection = cdddr(formFields)

insertionFields = list()
rangeLabel = list(hiCreateLabel(?name 'rangeLabel ?labelText "Range") 200:100 95:28)
insertionFields = append1(insertionFields rangeLabel)

foreach( cvn cornerVariations->?
newStringField = hiCreateStringField(
?name stringToSymbol(strcat("strip" sprintf(nil "%d" rowCounter) "StringField"))
?prompt sprintf(nil "%d" rowCounter)
)
newStringField = list(newStringField 0:100+dY*rowCounter 270:28 100)
insertionFields = append1(insertionFields newStringField)
)

newFieldsList = append(upToCornerSelection insertionFields)
newFieldsList = append(newFieldsList afterCornerSelection)

plotterForm->fieldList = newFieldsList

rowCounter = rowCounter + 1

Thank you in advance.

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    You can't just update the list. You need to call hiAddField or hiAddFields to add them - see this example for details.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dragank
    dragank over 4 years ago in reply to Andrew Beckett

    I replaced misused code and now I have:

    dY = 30
    rowCounter = 1
    formFields = plotterForm->fieldList
    upToCornerSelection = list()
    insertionContainer = cadddr(formFields)

    rangeLabel = list(hiCreateLabel(?name 'rangeLabel ?labelText "Range") 0:50 100:28)
    hiAddField(insertionContainer rangeLabel)

    foreach( cvn cornerVariations->?
      newStringField = hiCreateStringField(
                         ?name stringToSymbol(strcat("strip" sprintf(nil "%d" rowCounter) "StringField"))
                         ?prompt sprintf(nil "%d" rowCounter)
                       )
      newStringField = list(newStringField 0:100+dY*rowCounter 270:28 100)
      hiAddField(insertionContainer newStringField)
      rowCounter = rowCounter + 1
    )

     insertionContainer gets evaluated as "hiCreateScrollRegion"  

    I need it as a contained to populate fields programmatically.

    But no luck so far.

    I have CIW Error:

    *** Error in routine error:
    Message: *Error* hiAddField: argument #1 must be a form struct, scroll region, or hiLayout.

    Entering new debug toplevel due to error:

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to dragank

    Debugging this without seeing all the code is rather difficult - I suggest you contact customer support. Otherwise we're sailing blind!

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dragank
    dragank over 4 years ago in reply to Andrew Beckett

    Thanks again.

    I added "dyn_" prefix to dynamically populated fielda, so I can distinct them from static fields.

    This way I can add  them and remove them programmatically  as needed.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • dragank
    dragank over 4 years ago in reply to Andrew Beckett

    Thanks again.

    I added "dyn_" prefix to dynamically populated fielda, so I can distinct them from static fields.

    This way I can add  them and remove them programmatically  as needed.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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