• 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. Pass current cellview ID to callback of a form

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 144
  • Views 7875
  • 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

Pass current cellview ID to callback of a form

Martinsh
Martinsh over 2 years ago

Dear Sir,

I'd like to pass the current cellview ID (when the form displayed) to callback function of the form. So before the form is diaplayed, I use cv = geGetEditCellView() to get the current cellview ID, then I put it into the callback fucntion  ?callback "xpCreateInstArrayCb(hiGetCurrentForm() cv)"

When the form is created with hiCreateAppForm() function, it works well. But if the form is created with hiCreateLayoutForm() function, it can't work. When the callback is triggered, following error is reported:

*Error* eval: unbound variable - cv

Following are the skill code. Please help.

;;Case 1, works well

cv = geGetEditCellView(); Cellview when formXpCreateInstArray is created or displayed.
when( !boundp('formXpCreateInstArray) || (formXpCreateInstArray == nil)

formXpCreateInstArray = hiCreateAppForm(
?name 'formXpCreateInstArray
?formTitle "Create Instance Array"
?fields list(

hiCreateFloatField(
?name 'deviceSpacing
?value 60.0
?prompt "Spacing"
))
?callback "xpCreateInstArrayCb(hiGetCurrentForm() cv)"
?unmapAfterCB t
?buttonLayout 'OKCancelApply
;?dialogStyle 'modal
)

)

;; Case 2, can't work

cv = geGetEditCellView(); Cellview when formXpCreateInstArray is created or displayed.

formXpCreateInstArray = hiCreateLayoutForm(
'formXpCreateInstArray
"Create Instance Array"
hiCreateFormLayout(
'formLayout
?items list(

hiCreateFloatField(
?name 'deviceSpacing
?value 60.0
?prompt "Spacing"
)

))
?callback "xpCreateInstArrayCb(hiGetCurrentForm() cv)"
?unmapAfterCB t
?buttonLayout 'OKCancelApply
;?dialogStyle 'modal
?minSize 400:200
) 

  • Cancel
Parents
  • drdanmc
    drdanmc over 2 years ago

    What if you create the form and then store the cellview ID in the form as a property and have the callback then access the form property?  The callback would just take the form as the argument.

    -Dan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Martinsh
    Martinsh over 2 years ago in reply to drdanmc

    That's a good idea but I don't know how to store the cellview ID as a form property.

    -Martin

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Martinsh
    Martinsh over 2 years ago in reply to drdanmc

    That's a good idea but I don't know how to store the cellview ID as a form property.

    -Martin

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to Martinsh

    Martin,

    Two choices. The first is to just call geGetEditCellView() in the callback:

    ?callback "xpCreateInstArrayCb(hiGetCurrentForm() geGetEditCellView())"

    which will then be the current cellView at the point you OK or Apply the form. If you want it to definitely be the cellView at the time you launched the form, then you can do:

    ;; Case 3, should work

    cv = geGetEditCellView(); Cellview when formXpCreateInstArray is created or displayed.

    formXpCreateInstArray = hiCreateLayoutForm(
      'formXpCreateInstArray
      "Create Instance Array"
      hiCreateFormLayout(
        'formLayout
        ?items list(
          hiCreateFloatField(
            ?name 'deviceSpacing
            ?value 60.0
            ?prompt "Spacing"
          )))
      ?callback "xpCreateInstArrayCb(hiGetCurrentForm() hiGetCurrentForm()->cv)"
      ?unmapAfterCB t
      ?buttonLayout 'OKCancelApply
      ;?dialogStyle 'modal
      ?minSize 400:200
    )
    ; store property on form
    formXpCreateInstArray->cv=cv

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Martinsh
    Martinsh over 2 years ago in reply to Andrew Beckett

    Andrew,

    It works well. Thanks!

    -Martin

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