I finally found the solution. I still don't know how and why because when I test the same code on another computer it does work without me adding these lines of codes.
So from the API Help for Name2 property, it is said :
If you are setting the name of a component:
Before executing a name...
Hello, this is my first time encountering this. I have double checked and all my variables just work fine and have the right values.
I did recently an update of SolidWorks and from what I read online I have to update references (already did).
Does anyone able to run this code on their computer...
Oh you are right. I might need to open the part to rename it. The example I found in the API help section doesn't need to open the part but seems like I must open it first. I will look at it again and let you know if that works. Thanks for the help !
Edit : I am able to rename parts using the...
Thanks, I want to rename parts name. I did as you suggested but the parts are not being renamed. Where did I get it wrong ?
Option Explicit
Sub main()
' Declare necessary variables
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swAssembly As...
Hello, I have an assembly that contains subassemblies. Our goal is to select all parts within the assembly (and subassemblies). Thanks for any help, suggestion
Our current macro doesn't allow us to select parts within subassemblies.
Dim swApp As SldWorks.SldWorks
Dim swModel As...
Happy Sunday everyone,
I am having trouble to finalize the creation of an add-in created in VStudio. I tested the code and userform and everything is working well.
Now I want to create the add-in and get it incorporated in SolidWorks itself. I have checked online but didn't manage to get it...