AnsweredAssumed Answered

Macro to select the first component in the model tree

Question asked by Mike Childs on May 31, 2018
Latest reply on Jun 1, 2018 by Ivana Kolin

I created an assembly and and have assembled a part that is used as a skeleton to attach the rest of the components. The skeleton part will always be the first component in the model tree and all of the other component placement dimensions are in that part. I need to be able to edit the skeleton part in my macro to modify the dimensions whenever there is a change to the assembly but the part name will vary every time the assembly is copied to a new folder within our PDM vault. Can anyone suggest a way I can select the skeleton component for editing regardless of what the component name is.

 

Another forum post I came across suggested an example to traverse the assembly at https://forum.solidworks.com/external-link.jspa?url=http%3A%2F%2Fhelp.solidworks.com%2F2016%2Fenglish%2Fapi%2Fsldworksap… but I'm hoping there is a simpler way to find the first component.

 

For clarification. The assembly will only have one config and the first assembled component, which is the skeleton part, will never be suppressed.

 

Thanks for the help.

Outcomes