Creating a user defined panel

vreddy
vreddy Altair Community Member
edited October 2020 in Community Q&A

How to create a panel with 10 buttons ??

 

Reference is attached as a file.

<?xml version="1.0" encoding="UTF-8"?>Capture.PNG

 

 

OR

Is there any way such that we can open connectors panel and get selected element type (with out going for new panel creation as mentioned above).

Answers

  • tinh
    tinh Altair Community Member
    edited July 2017

    :rolleyes:/emoticons/default_rolleyes.gif' title=':rolleyes:' /> 

    Do you mean, you want to popup a panel to select something to continue your script?

    example:

    #you're doing something

    #you need to input connector type:

    set SelectedConnector [...] ;# popup a panel to select connector type

    #continue process with selected connector...

     

    Are you writing a script like above?

  • vreddy
    vreddy Altair Community Member
    edited July 2017

    :rolleyes:/emoticons/default_rolleyes.gif' title=':rolleyes:' /> 

    Do you mean, you want to popup a panel to select something to continue your script?

    example:

    #you're doing something

    #you need to input connector type:

    set SelectedConnector [...] ;# popup a panel to select connector type

    #continue process with selected connector...

     

    Are you writing a script like above?

    yes , i want same thing as you mentioned.I want to select a type from connectors->element type panel ->use that type for creation.

     

  • tinh
    tinh Altair Community Member
    edited July 2017

    Hi,

    There a several ways, you can create your own panel by hm_framework, then push it and wait for its return.

    But I used an available hypermesh panel to do that B)/emoticons/default_cool.png' title='B)' />, you can try using this proc:

     proc hm_callmenupanel args {     set itemlist [lsort -unique $args]     #we will use plots, because they can be deleted without affect to our data     *entityhighlighting 0     *createmark plots 1 all     if {[hm_marklength plots 1]} {*deletemark plots 1}     hm_blockredraw 1     foreach item $itemlist {         *xyplotcreate $item ''         *displaycollectorwithfilter plots off $item 1 1     }     hm_blockredraw 0     set selected [hm_callcollectorpanel plots]     *createmark plots 1 all     if {[hm_marklength plots 1]} {*deletemark plots 1}     *entityhighlighting 1     set selected }

     

    Using it in your script like this:

    #need to input connector type:

    set SelectedConnector [ hm_callmenupanel 'acm (shellgap+coating)' 'acm (general)' 'penta (mig)' 'other connector types...' ]

    #continue process with selected connector...

     

     

  • vreddy
    vreddy Altair Community Member
    edited July 2017

    Thanks a lot tinh.It really helped me a lot.