Jump to content
Novice_Tcl_Scripter

Hyperview - Get list of components and ids

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...