I'm currently looking for a way to use a SolidWorks (VBA) macro to put a function of the creation tree in the deleted state or not (I have previously entered all the name of the dimension in my excel file).
If anyone has the solution, it would be very useful to me...
Just right-click on the function then properties of the function and you choose delete and choose either in this configuration or all configurations or specify the configuration(s).... The result is the same, as many clicks and less annoying to do...
Have you thought about taking a look at DriveWorksXpress?
DriveWorksXpress is a free tool that allows you to automate your designs. One of the features is the ability to change the state (deleted or not) of one or more SolidWorks functions.
In fact I think he would like to have a small "drop-down" menu with the deleted and undeleted in the creation tree. But for that you should rather see to develop an addon or if it exists ....
I finally found the solution and it is the same as the one you proposed to me.
I created a small macro that looks for the name of the coast in my excel and then selects it on the 3D part to modify its state.
name = Cells(2, i). Value Searchstring = name SearchChar="@" mypos = InStr(1, Searchstring, SearchChar, 1) nom_cote = Right(Searchstring, Len(name) - Mypos) 'counts the number of characters and subtracts the Mypos from it Set Part = swApp.ActiveDoc boolstatus = Part.Extension.SelectByID2(nom_cote, "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0) Part.EditSuppress2