Macro for Toggling Transparency of Components
Macro for Toggling Transparency of Components
Hello forum,
My 1st post here! looking for a macro which I think might be helpful for all actually.
So you know how you can use tab and shift-tab to hide & unhide hovered components; love that feature, super convenient, right?
Can something like that be done but for transparency (basically a toggle)? Hover would be best, but I assume it won't be as easy? How about pre-selecting the component, press a key (assigned to the said macro), make the part transparent, click again and make it opaque? I searched for such a macro a bit, no luck.
Thanks in advance!
Vahid
My 1st post here! looking for a macro which I think might be helpful for all actually.
So you know how you can use tab and shift-tab to hide & unhide hovered components; love that feature, super convenient, right?
Can something like that be done but for transparency (basically a toggle)? Hover would be best, but I assume it won't be as easy? How about pre-selecting the component, press a key (assigned to the said macro), make the part transparent, click again and make it opaque? I searched for such a macro a bit, no luck.
Thanks in advance!
Vahid
This is a one-liner macro. You can easily assign it to a hot key. Pre-selection of one or more components is required.Slasher wrote: ↑Mon Oct 23, 2023 6:20 pm Hello forum,
My 1st post here! looking for a macro which I think might be helpful for all actually.
So you know how you can use tab and shift-tab to hide & unhide hovered components; love that feature, super convenient, right?
Can something like that be done but for transparency (basically a toggle)? Hover would be best, but I assume it won't be as easy? How about pre-selecting the component, press a key (assigned to the said macro), make the part transparent, click again and make it opaque? I searched for such a macro a bit, no luck.
Thanks in advance!
Vahid
Code: Select all
Dim swApp As Object
Sub main()
Set swApp = Application.SldWorks
swApp.RunCommand swCommands_e.swCommands_ChangeTransparency, ""
End Sub
Re: Macro for Toggling Transparency of Components
There's no need for a macro. Toggle transparency is already a button in the UI. You can map the command to a shortcut key.
Re: Macro for Toggling Transparency of Components
Hi Josh,
I'm using 2020 and transparency toggle or anything like that won't shop up in the commands (under keyboard tab in customize menu) when you search for it.
I'm using 2020 and transparency toggle or anything like that won't shop up in the commands (under keyboard tab in customize menu) when you search for it.
Re: Macro for Toggling Transparency of Components
I think this shows up by default when you click on a part
Re: Macro for Toggling Transparency of Components
According to the swamp the answer is no. It is an old thread, but has replies from the last few months.
https://r1132100503382-eu1-3dswym.3dexp ... 9ijKAr-pKg
If you are trying to write a macro, I think this is the call you are looking for.
https://help.solidworks.com/2020/englis ... Redirect=1
https://r1132100503382-eu1-3dswym.3dexp ... 9ijKAr-pKg
If you are trying to write a macro, I think this is the call you are looking for.
https://help.solidworks.com/2020/englis ... Redirect=1
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
Re: Macro for Toggling Transparency of Components
Yeah I am aware of that, but I'm trying to avoid the extra clicks. I like to be able to assign a key to it and toggle quickly between opaque and transparent, solidworks currently doesn't allow that, hence my inquiry about a macro that can do that.
Re: Macro for Toggling Transparency of Components
Thanks for the link...for a second I thought I'm missing something after @josh comment, but yeah definitely you can't assign a hotkey to this command without a macro.SPerman wrote: ↑Tue Oct 24, 2023 4:32 pm According to the swamp the answer is no. It is an old thread, but has replies from the last few months.
https://r1132100503382-eu1-3dswym.3dexp ... 9ijKAr-pKg
If you are trying to write a macro, I think this is the call you are looking for.
https://help.solidworks.com/2020/englis ... Redirect=1
As for the api link, unfortunately I am not knowledgeable enough to write the macro
Re: Macro for Toggling Transparency of Components
I went through the settings in SW and couldn't find it either.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
Re: Macro for Toggling Transparency of Components
Found this thread from eng-tips which is about same request; but the link referenced there to the macro is dead
https://www.eng-tips.com/viewthread.cfm?qid=140985
https://www.eng-tips.com/viewthread.cfm?qid=140985
Re: Macro for Toggling Transparency of Components
This will take you to the knowledge base. From there you can search for that SPR.
https://support.3ds.com/knowledge-base/
https://support.3ds.com/knowledge-base/
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
Re: Macro for Toggling Transparency of Components
Based on that link, it is possible the creator of these forums could be the author of that macro.
@matt
@matt
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
Re: Macro for Toggling Transparency of Components
This is a one-liner macro. You can easily assign it to a hot key. Pre-selection of one or more components is required.Slasher wrote: ↑Mon Oct 23, 2023 6:20 pm Hello forum,
My 1st post here! looking for a macro which I think might be helpful for all actually.
So you know how you can use tab and shift-tab to hide & unhide hovered components; love that feature, super convenient, right?
Can something like that be done but for transparency (basically a toggle)? Hover would be best, but I assume it won't be as easy? How about pre-selecting the component, press a key (assigned to the said macro), make the part transparent, click again and make it opaque? I searched for such a macro a bit, no luck.
Thanks in advance!
Vahid
Code: Select all
Dim swApp As Object
Sub main()
Set swApp = Application.SldWorks
swApp.RunCommand swCommands_e.swCommands_ChangeTransparency, ""
End Sub
Re: Macro for Toggling Transparency of Components
Nothing will show up when I look up this SPR:SPerman wrote: ↑Wed Oct 25, 2023 10:37 am This will take you to the knowledge base. From there you can search for that SPR.
https://support.3ds.com/knowledge-base/
Re: Macro for Toggling Transparency of Components
Thanks! I will give it a try, hopefully SOLIDWORKS add it with the hover functionality!JSculley wrote: ↑Wed Oct 25, 2023 10:44 am This is a one-liner macro. You can easily assign it to a hot key. Pre-selection of one or more components is required.
Code: Select all
Dim swApp As Object Sub main() Set swApp = Application.SldWorks swApp.RunCommand swCommands_e.swCommands_ChangeTransparency, "" End Sub
Re: Macro for Toggling Transparency of Components
That's a really REALLY old link. 20 years old or more. I think that's an address I had when I lived in Rochester. REALLY old. 20+ years.
Blog: http://dezignstuff.com
- AlexLachance
- Posts: 2195
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2382
- x 2021
Re: Macro for Toggling Transparency of Components
At least it wasn't a MySpace page.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
Re: Macro for Toggling Transparency of Components
They gave dialup customers FTP space. I had a website in 1995. I posted user group presentations. The whole format translated perfectly into blogs. This was back when Verizon was a regular phone company, before they became a wireless juggernaut.
Blog: http://dezignstuff.com