Hello
I have some notions of VBA knowing that I have already made a lot of applications in excel.
On the other hand, VBA SolidWorks, I shit a little...
I have one of my customers who regularly orders drawing vats from me. On top of the vats, I have most of my stitching. I'm making a macro that will automatically create ONE stitching. I open a userform with different information to fill in such as the angle of the drilling, the diameter, the thickness of the tap etc.
So far, everything goes well, I get the info, I create my sketch that I quote.
And this is where it gets stuck: I want to select the object that I want to make a hole in because I can't name it directly. Indeed, when I want to position another stitch, the object in question will have changed its name (the idiot)!
Unfortunately, when I select the part, there is no way to succeed in the extrusion! and I can't find why!
I present to you the part of my code that bugs (I had put the entire script but I exceeded the limit of 6000 characters)
If someone has an idea and can explain it to me, I'm all for it...
'*****************************************************
'Enlèvement matière
'*****************************************************
MsgBox "Sélection du cône à extruder"
Dim Feature As Object
Set Feature = Part.SelectionManager.GetSelectedObject6(1, 0)
Do While Feature Is Nothing
DoEvents
Set Feature = Part.SelectionManager.GetSelectedObject6(1, 0)
Loop
Dim myFeature As Object
Set myFeature = Part.FeatureManager.FeatureCut4(True, False, False, 1, 0, 0.01, 0.01, False, False, False, False, 1.74532925199433E-02, 1.74532925199433E-02, False, False, False, False, False, True, False, True, True, False, 0, 0, False, False)