🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Hyperview - Get list of components and ids

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Hello! I am a new to TCL scripting to work with Hyperworks tools. I need a TCL script for Hyperview that will read and write all the component names and their respective ids. Writing it to the clipboard for pasting or writing to a csv/excel file would be most helpful.

 

Thanks ahead of time!

Find more posts tagged with

Sort by:
1 - 3 of 31
    User: "llyle_20499"
    New Altair Community Member
    Updated by llyle_20499

    Hi,

    It's fairly direct. 

     hwi OpenStack hwi GetSessionHandle session1 session1 GetProjectHandle project1 project1 GetPageHandle page1 1 page1 GetWindowHandle win1 1 win1 GetClientHandle anim anim GetModelHandle my_model [anim GetActiveModel] my_model GetQueryCtrlHandle my_query set set_id [my_model AddSelectionSet component] my_model GetSelectionSetHandle comp_set $set_id # Select all Components comp_set Add 'All' my_query SetSelectionSet $set_id # ask for ids and component name my_query SetQuery 'component.id component.name' my_query WriteData D:/out.csv # clean up my_model RemoveSelectionSet $set_id hwi CloseStack

     

    User: "Sagar Motwani_20540"
    Altair Community Member
    Updated by Sagar Motwani_20540

    Can some would suggest me script for read and write all the subcase names and their respective ids, for now to get all subcases names, I am using-

    hwi GetSessionHandle mySessionName

    mySessionName GetDataFileHandle myDataFile $op2File
        
    set subcase_list [myDataFile GetSubcaseList] 
    puts 'subcase_list $subcase_list'

     

    can some suggest script or code to find all Subcases ids with minimal changes in above.

    User: "llyle_20499"
    New Altair Community Member
    Updated by llyle_20499
    https://community.altair.com/community?id=community_question&sys_id=10664cf61b2bd0908017dc61ec4bcbef

    For subcase names, pass result_handle GetSubcaseLabel $n_subcaseID