Hello
In DriveWorks Pro I have 2 related problems. I have a room "A" that has two configurations: "roughing" and "finishing" and two planes that each point to one of these configurations. I would like to rename the "draft" configuration to "02" and "finish" to "01" and that the link with the drawings is not broken, how to do it?
Currently I am creating several Generation Tasks as follows: "Switch Configuration" to "draft" + "Create Configuration" "02" + "Switch Configuration" to "finishing" + "Create Configuration" "01" + "Delete Configuration" "draft" then "finishing".
This works for 3D but the links in 2D are broken. Is there a way to do this more simply (for example by renaming the configuration and having it follow in the 2D)
Thanks in advance
Hello Nicolas,
Why not name your configurations "01" and "02" directly in your 3D Master?
In this way, the links would be preserved.
Hello Johan,
It was to simplify the problem. Because the idea is to have a master part named 333.99.xxx.dd.zz configurable (xxx length, dd diameter, zz status) having two distinct machining configurations (roughing and finishing) whose serial number will include the parameter information. For example, if the user chooses to create a part with length L=200mm and diameter D=25mm then the blank will have the number 333.99.200.25.02 and the finish 333.99.200.25.01. Each piece will have a different number. And these numbers are then taken over in our ERP.
Hello!
DriveWorks does not allow renaming configurations in its current version, but I can confirm that the suggestion is in our system.
The use case is interesting, have you tried the manip of renaming the configurations manually and the drawings follow correctly?
If so, I'd like to suggest creating a SOLIDWORKS macro (the APIs seem pretty simple) and asking DriveWorks to run it during model generation with a 'Generation Task':
https://docs.driveworkspro.com/Topic/GTRunSOLIDWORKSMacro
Kind regards
Thomas
Hello Thomas,
I tried to manually change the name of the setup in the 3D, and whether the 2D is open or closed, the change follows in the 2D. So, as you suggest, it seems possible to use this way of doing things and create a macro.
However, I have never coded in SolidWorks, created APIs and others. Do you have by any chance a link or document that explains this well? (before I waste too much time researching ^^).
Thank you for your answer in any case :-D!
Nico
Super!
I don't have a reference to share for VBA SOLIDWORKS development, especially in French, other members surely have recommendations?
For a beginning of a track, see below for a beginning of a Macro that I did quickly which renames a "Before" configuration to "After".
See images for reference.
Hoping it's a good start.
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swConf As SldWorks.Configuration
Sub main()
Set swApp = Application.SldWorks
Set sMmodel = swApp.IActiveDoc2
Set swConf = swModel.GetConfigurationByName("Avant")
swConf.Name = "Apres"
End Sub
macroavant.png
Thank you very much for your answer and sorry for my very late answer (holidays).
I tested your example and it seems to work (be careful, there's just a typo: "Set swModel = ... " and not "Set sMmodel = ... ")
Now I have to try to store the name of the part in a variable to use it for the naming of the configuration and also define in the "Nomenclature Options" under the properties of the configuration in the Configuration Manager that it is the "Name of the document" that is displayed and not the "Name of the configuration". I'll post again when I've been able to test all this.