Do action which can refer from the current component

Yu-Ju Chen_20500
Yu-Ju Chen_20500 Altair Community Member
edited October 2020 in Community Q&A

I wrote a customization script as a button, and it can help me to create elements.

 

To avoid making mistake, I hope that after I press the button, the created elements can be organized to the current component manually operation.

 

Which script can I add into the customization script?

 

Thanks

Answers

  • Pandurang
    Pandurang Altair Community Member
    edited April 2019

    Hi

     

    *currentcollector component Component_name

     

    use this api before creating element

  • Yu-Ju Chen_20500
    Yu-Ju Chen_20500 Altair Community Member
    edited April 2019

    Hi

     

    *currentcollector component Component_name

     

    use this api before creating element

    Hi, Pandurang,

     

    Because this button will be used many times, I cannot assign a component name or id  only for this script.

    Or do you know how to write a script to get the component'id which is made current?

     

    thanks

  • Pandurang
    Pandurang Altair Community Member
    edited April 2019

    Use this one to get current component Name

     

    hm_info currentcomponent

  • Yu-Ju Chen_20500
    Yu-Ju Chen_20500 Altair Community Member
    edited April 2019

    Use this one to get current component Name

     

    hm_info currentcomponent

     

    Thanks a lot!!!

  • Pandurang
    Pandurang Altair Community Member
    edited April 2019

    This is to get id of current component:

     

    hm_getvalue component name = [hm_info currentcomponent] dataname = id