Jump to content
harmeek01

Creating Assembly Hierarchy from Excel and Script

Recommended Posts

Hi Experts,

 

I want to automate the assembly creation, I can go in 2 ways.

1. Create an assembly hierarchy in excel file and use the script to implement in my hm file.

2. Create a script to create the assembly hierarchy in hm itself using the user input (selecting the sub-assemblies and components together to form an assembly).

Which option would be easier and feasible.

 

I am just a beginner in TCL.

Thanks in advance!!

Share this post


Link to post
Share on other sites
1 hour ago, harmeek01 said:

Hi Experts,

 

I want to automate the assembly creation, I can go in 2 ways.

1. Create an assembly hierarchy in excel file and use the script to implement in my hm file.

2. Create a script to create the assembly hierarchy in hm itself using the user input (selecting the sub-assemblies and components together to form an assembly).

Which option would be easier and feasible.

 

I am just a beginner in TCL.

Thanks in advance!!

 

Hi, 

both are feasible, option (2) is easier because it does not have to parse the excel file

Share this post


Link to post
Share on other sites

Thanks a lot for the info!!

I`ve started working on it but I want to know the command for either of these

1. How to get the assembly ID of a component.

2. How can I get the list of component ID's in an Assembly.

 

Please share.

 

Thanks and Regards

Harmeek

Share this post


Link to post
Share on other sites

Hello

- to get assembly IDs of a component (not unique, because one comp can belong to several assems)

*createmark comps 1 "by id only" $CompId
*findmark comps 1 1 1 assems 0 2
set AssemIdList [hm_getmark assems 2]

 

- to get comp IDs in an assem:

set CompIdList [hm_getvalue assems id=$AssemId dataname=components]

 

Share this post


Link to post
Share on other sites

Hello,

 

I am trying to isolate/show assemblies but when I use

 

*startnotehistorystate {show Assembly}
*createmark assemblies 2 $isolate_assembly
*createstringarray 2 "elements_on" "geometry_on"
*showentitybymark 2 1 2
*endnotehistorystate {show Assembly}

 

it dosen't work, but instead of variable if I use assembly name directly it works.

 

Am i missing out something? But using variable name for components worked well.

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...