make envelope items standard components

User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

make envelope items standard components

Unread post by Bradfordzzz »

Is there a way to make envelope items standard components for all components in an Assembly, that has many components and subassemblies with many components? All files are currently enveloped.

Thanks,
Mark
by DanPihlaja » Tue Aug 15, 2023 9:38 am
AHAH! Try this!

I just tested it out and it works.

First of all, Make sure that everything is NOT hidden in your assembly first. There are no hidden components.

Then RMB on your top level and select "Hide all envelopes"
image.png
Now, under your selection tool bar, select "Select Hidden"
image.png
Them RMB on them and Select your properties and Envelope won't be greyed out.
Go to full post
User avatar
AlexLachance
Posts: 2166
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2344
x 2003

Re: make envelope items standard components

Unread post by AlexLachance »

I'm not sure I understand the question. What do you refer to as standard components?
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

Just remove the envelope. Currently have to go in each subassembly and select all components ... then go to component properties, and un check the envelope. This customers assembly is huge, and everything is individually enveloped. Hoping there is is a way to select all assemblies with dependents and uncheck the envelope option on all. This is going to take a great deal of time manually!
User avatar
mattpeneguy
Posts: 1386
Joined: Tue Mar 09, 2021 11:14 am
Answers: 4
x 2489
x 1899

Re: make envelope items standard components

Unread post by mattpeneguy »

You should be able to do it with a macro, if there isn't an easier way.
User avatar
DanPihlaja
Posts: 833
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 802
x 967

Re: make envelope items standard components

Unread post by DanPihlaja »

So there is "sort of" a way.

If you use Assembly Visualization, you can add a column called "Excluded From BOM".
(by default, all envelope components are excluded from BOM).

Then you can sort by that column. Which puts all the envelope components at the top of the list.

Unfortunately, you cannot Multi-select and uncheck "Envelope" as it is greyed out as soon as you have more than 1 selected.

But, it will give you all the components right there in front of you.

I will look a little deeper to see if envelope can be toggled off on multiple things at once.
image.png
image.png
image.png (31.43 KiB) Viewed 3263 times
image.png
image.png (13.92 KiB) Viewed 3263 times
image.png
image.png (16.46 KiB) Viewed 3263 times
image.png
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
DanPihlaja
Posts: 833
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 802
x 967

Re: make envelope items standard components

Unread post by DanPihlaja »

OK, what I found was that, if you multi select components and ALL the components that you have selected are ALL envelope, then you can toggle off envelope for all of them all at once.
image.png
image.png
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

DanPihlaja wrote: Tue Aug 15, 2023 8:13 am So there is "sort of" a way.

If you use Assembly Visualization, you can add a column called "Excluded From BOM".
(by default, all envelope components are excluded from BOM).

Then you can sort by that column. Which puts all the envelope components at the top of the list.

Unfortunately, you cannot Multi-select and uncheck "Envelope" as it is greyed out as soon as you have more than 1 selected.

But, it will give you all the components right there in front of you.

I will look a little deeper to see if envelope can be toggled off on multiple things at once.
Thanks Dan,

Yeah .. I can find a couple of ways to get them all selected .. but the option to toggle off the envelope has been greyed out each time so far. frustrating. seems like it should be such an easy thing. can help but feel like I am just missing the option somewhere, but can't find anything on google for this either.
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

mattpeneguy wrote: Tue Aug 15, 2023 8:08 am You should be able to do it with a macro, if there isn't an easier way.
Thanks Matt .. I've been looking for one, but havent had any luck there either.
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

DanPihlaja wrote: Tue Aug 15, 2023 8:16 am OK, what I found was that, if you multi select components and ALL the components that you have selected are ALL envelope, then you can toggle off envelope for all of them all at once.

image.png

image.png
The problem for this assembly is there are many sub assemblies inside of sub assemblies, and they all of teh components have envelopes .. so the option is always greyed out. I am having to expand the entire assembly and manually select each component in order for it to not be grayed out.
looking for a a tool to "select all envelopes" so then I can uncheck that option .. but no luck there
User avatar
mattpeneguy
Posts: 1386
Joined: Tue Mar 09, 2021 11:14 am
Answers: 4
x 2489
x 1899

Re: make envelope items standard components

Unread post by mattpeneguy »

There's this from a quick google search on changing a part to an envelope part:
https://help.solidworks.com/2021/englis ... ple_vb.htm
You'd need to figure out which "True" to change to false and then wrap it in a loop to go through the assembly.
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

mattpeneguy wrote: Tue Aug 15, 2023 8:28 am There's this from a quick google search on changing a part to an envelope part:
https://help.solidworks.com/2021/englis ... ple_vb.htm
You'd need to figure out which "True" to change to false and then wrap it in a loop to go through the assembly.
Thanks Matt .. I found that one too .. but it doesn't actually go into all of the sub assemblies inside of other subassemblies to select all the components and then continue with all the components and all of their dependents. I don't know enough enough VBA to alter this unfortunately.
User avatar
mattpeneguy
Posts: 1386
Joined: Tue Mar 09, 2021 11:14 am
Answers: 4
x 2489
x 1899

Re: make envelope items standard components

Unread post by mattpeneguy »

Here's further information:
https://help.solidworks.com/2019/englis ... ties6.html
Looks like it's the second to last true in the above link that needs to be changed to false:
image.png
User avatar
mattpeneguy
Posts: 1386
Joined: Tue Mar 09, 2021 11:14 am
Answers: 4
x 2489
x 1899

Re: make envelope items standard components

Unread post by mattpeneguy »

Here's the loop through assembly that will be the other part:
https://help.solidworks.com/2023/englis ... Redirect=1
The API help the people at SW provide is pretty darn good.

If I get some time today I may be able to kludge it together. But if you want something clean, @josh, @gupta9665, @artem, or one of the other actual programmers would have to weigh in.
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

mattpeneguy wrote: Tue Aug 15, 2023 8:42 am Here's the loop through assembly that will be the other part:
https://help.solidworks.com/2023/englis ... Redirect=1
The API help the people at SW provide is pretty darn good.

If I get some time today I may be able to kludge it together. But if you want something clean, @josh, @gupta9665, @artem, or one of the other actual programmers would have to weigh in.
Thanks for finding all of this Matt. I can sort of understand the individual bits of code and what they are doing, but I don't have the knowledge it would take to put this into a working macro. definitely beyond my abilities unfortunately.
User avatar
JSculley
Posts: 634
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 866

Re: make envelope items standard components

Unread post by JSculley »

FYI: There are 3 separate SPRs requesting the ability to select envelopes via Advanced Selection

SPR542629 - Cannot select assembly envelope components through the Advanced Selection criteria
SPR666548 - It should be possible to identify and select envelope components with advanced selection or with assembly visualization
SPR1059850 - Ability to select components which are excluded from BOM (Bill of Materials) and Envelope Components in Component Selection tools, and Advanced Selection
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

JSculley wrote: Tue Aug 15, 2023 8:54 am FYI: There are 3 separate SPRs requesting the ability to select envelopes via Advanced Selection

SPR542629 - Cannot select assembly envelope components through the Advanced Selection criteria
SPR666548 - It should be possible to identify and select envelope components with advanced selection or with assembly visualization
SPR1059850 - Ability to select components which are excluded from BOM (Bill of Materials) and Envelope Components in Component Selection tools, and Advanced Selection
Great to know... I'll add my name to them too. Thanks
User avatar
AlexLachance
Posts: 2166
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2344
x 2003

Re: make envelope items standard components

Unread post by AlexLachance »

Can you provide some images please? I've never encountered enveloppes that couldn't be toggled off.

A bit more context would help in perhaps getting more solutions.
User avatar
DanPihlaja
Posts: 833
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 802
x 967

Re: make envelope items standard components

Unread post by DanPihlaja »

JSculley wrote: Tue Aug 15, 2023 8:54 am FYI: There are 3 separate SPRs requesting the ability to select envelopes via Advanced Selection

SPR542629 - Cannot select assembly envelope components through the Advanced Selection criteria
SPR666548 - It should be possible to identify and select envelope components with advanced selection or with assembly visualization
SPR1059850 - Ability to select components which are excluded from BOM (Bill of Materials) and Envelope Components in Component Selection tools, and Advanced Selection
Yeah, that was the first thing that I checked. I remembered seeing this (below) and thought that this would do it, but it doesn't mean an envelope component. It means something else.
image.png
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
DanPihlaja
Posts: 833
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 802
x 967

Re: make envelope items standard components

Unread post by DanPihlaja »

AlexLachance wrote: Tue Aug 15, 2023 9:15 am Can you provide some images please? I've never encountered enveloppes that couldn't be toggled off.

A bit more context would help in perhaps getting more solutions.
He is trying to multi select envelope components to turn them off he has hundreds of them.

Unfortunately, if the components that you have multi selected aren't ALL envelope, then you cannot turn off envelope en-masse.

Also, I don't think that you can select multi-levels and turn them off en-masse either.

So, it sounds like a lot of work.
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

AlexLachance wrote: Tue Aug 15, 2023 9:15 am Can you provide some images please? I've never encountered enveloppes that couldn't be toggled off.

A bit more context would help in perhaps getting more solutions.
You can see that the Envelope toggle box is greyed out here. Thats because in this assembly, and in a subassembly is a component that isn't in an envelope. so since there is something not in an envelope .. the option is greyed out. I need a way to select ONLY all assemblies and their dependents that are in an envelope so that I can toggle that option on all of those components. currently, I can find a way to do this without manually expanding each assembly and subassembly and selecting only the enveloped components and assemblies. this will take hours on this assembly becuase of its size. Im was thinking there might be an easier way .. but its looking like a macro might be the only way.
image.png
User avatar
josh
Posts: 290
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 15
x 21
x 497

Re: make envelope items standard components

Unread post by josh »

This will select all envelope components at any level. You should then be able to toggle envelope off.
Sub main()
Dim swapp As SldWorks.SldWorks
Dim swDoc As SldWorks.AssemblyDoc
Dim swComp As SldWorks.Component2
Dim vComps As Variant
Set swapp = Application.SldWorks
Set swDoc = swapp.ActiveDoc
vComps = swDoc.GetComponents(False)
Dim i As Long
swDoc.ClearSelection2 True
For i = 0 To UBound(vComps)
Set swComp = vComps(i)
If Not (swComp.IsEnvelope = False) Then
swComp.Select2 True, 1
End If
Next i

End Sub
User avatar
DanPihlaja
Posts: 833
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 802
x 967

Re: make envelope items standard components

Unread post by DanPihlaja »

AHAH! Try this!

I just tested it out and it works.

First of all, Make sure that everything is NOT hidden in your assembly first. There are no hidden components.

Then RMB on your top level and select "Hide all envelopes"
image.png
Now, under your selection tool bar, select "Select Hidden"
image.png
Them RMB on them and Select your properties and Envelope won't be greyed out.
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

This works perfectly. Thanks for this solution Dan !!
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

josh wrote: Tue Aug 15, 2023 9:34 am This will select all envelope components at any level. You should then be able to toggle envelope off.
Sub main()
Dim swapp As SldWorks.SldWorks
Dim swDoc As SldWorks.AssemblyDoc
Dim swComp As SldWorks.Component2
Dim vComps As Variant
Set swapp = Application.SldWorks
Set swDoc = swapp.ActiveDoc
vComps = swDoc.GetComponents(False)
Dim i As Long
swDoc.ClearSelection2 True
For i = 0 To UBound(vComps)
Set swComp = vComps(i)
If Not (swComp.IsEnvelope = False) Then
swComp.Select2 True, 1
End If
Next i

End Sub
Thanks Josh ! This works perfectly !
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

Really appreciate you all working thru the problem with me. Helped me quite a bit. Thank you all.
User avatar
AlexLachance
Posts: 2166
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2344
x 2003

Re: make envelope items standard components

Unread post by AlexLachance »

DanPihlaja wrote: Tue Aug 15, 2023 9:29 am He is trying to multi select envelope components to turn them off he has hundreds of them.

Unfortunately, if the components that you have multi selected aren't ALL envelope, then you cannot turn off envelope en-masse.

Also, I don't think that you can select multi-levels and turn them off en-masse either.

So, it sounds like a lot of work.
Well, a solution was provided. If that one fails, then you can hide all and then toggle "show all enveloppes" and proceed to do a similar process.
User avatar
josh
Posts: 290
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 15
x 21
x 497

Re: make envelope items standard components

Unread post by josh »

It should probably be noted that selecting all envelopes (or any big bunch o’ components) and hitting the “Properties” box may change more than just the property you want. There’s no way to specify “Only change the envelope property”. This will also change suppression states, flexible/rigid, and maybe more.
User avatar
gupta9665
Posts: 403
Joined: Thu Mar 11, 2021 10:20 am
Answers: 25
Location: India
x 424
x 444

Re: make envelope items standard components

Unread post by gupta9665 »

Add following line before end sub to remove the envelope option for bulk. But please note that any component solve state, suppression, etc. wil change like @josh has stated.

swDoc.CompConfigProperties6 2, 0, True, True, swComp.ReferencedConfiguration, False, False, 0

Remove Envelope.png
But you can also replace

swComp.Select2 True, 1

with

swComp.CompConfigProperties6 swComp.GetSuppression2, 0, swComp.Visible, True, swComp.ReferencedConfiguration, False, False, 0


This will only change solve state and assembly save as part option. Rest properties will remain intact.
Deepak Gupta
SOLIDWORKS Consultant/Blogger
User avatar
DanPihlaja
Posts: 833
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 802
x 967

Re: make envelope items standard components

Unread post by DanPihlaja »

josh wrote: Tue Aug 15, 2023 10:20 am It should probably be noted that selecting all envelopes (or any big bunch o’ components) and hitting the “Properties” box may change more than just the property you want. There’s no way to specify “Only change the envelope property”. This will also change suppression states, flexible/rigid, and maybe more.
It shouldn't. It only changes the things that you specifically change. If you select it in the box. Has worked in the past before. Unless there is some thing that I have missed (which is always a possibility) UU
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
josh
Posts: 290
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 15
x 21
x 497

Re: make envelope items standard components

Unread post by josh »

DanPihlaja wrote: Tue Aug 15, 2023 11:10 am It shouldn't. It only changes the things that you specifically change. If you select it in the box. Has worked in the past before. Unless there is some thing that I have missed (which is always a possibility) UU
You're right. It shouldn't. But it does. At least in 22sp4. I made 2 comps envelope, then suppressed one of them. Selected both, and changed back to non-envelope. The suppressed one became resolved. Did the same thing with a couple subassemblies and their rigid/flexible setting. Ended up with both set to rigid.
User avatar
DanPihlaja
Posts: 833
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 802
x 967

Re: make envelope items standard components

Unread post by DanPihlaja »

josh wrote: Tue Aug 15, 2023 11:31 am You're right. It shouldn't. But it does. At least in 22sp4. I made 2 comps envelope, then suppressed one of them. Selected both, and changed back to non-envelope. The suppressed one became resolved. Did the same thing with a couple subassemblies and their rigid/flexible setting. Ended up with both set to rigid.
Now that you mention it, when I was playing around with this fix, I noticed the same thing with regards to suppressed/unsuppressed state. (I am also using 2022 SP4). I didn't think anything of it at the time, thinking that maybe it was a fluke.
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
AlexLachance
Posts: 2166
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2344
x 2003

Re: make envelope items standard components

Unread post by AlexLachance »

josh wrote: Tue Aug 15, 2023 11:31 am You're right. It shouldn't. But it does. At least in 22sp4. I made 2 comps envelope, then suppressed one of them. Selected both, and changed back to non-envelope. The suppressed one became resolved. Did the same thing with a couple subassemblies and their rigid/flexible setting. Ended up with both set to rigid.
It does that in 2019 also.
User avatar
Bradfordzzz
Posts: 234
Joined: Tue Mar 16, 2021 6:26 am
Answers: 0
Location: Windsor, ON
x 334
x 207

Re: make envelope items standard components

Unread post by Bradfordzzz »

josh wrote: Tue Aug 15, 2023 11:31 am You're right. It shouldn't. But it does. At least in 22sp4. I made 2 comps envelope, then suppressed one of them. Selected both, and changed back to non-envelope. The suppressed one became resolved. Did the same thing with a couple subassemblies and their rigid/flexible setting. Ended up with both set to rigid.
It did the same for me ... but in my case it didnt really matter. But its a good thing to be aware of for sure!
Post Reply