ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
WJWitold Janik12/10/2021

Good morning,
I would appreciate any help or any suggestion to solve the problem.
The film shows the registration of a simple action: converting elements to a sketch.
Registered macro looks like this:
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main ()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByRay (3.05115602275068E-03, -1.92111892697995E-03, 1, 0, 0, -1, 5.37372050817517E-04, 2, False, 0, 0)
boolstatus = Part.SketchManager.SketchUseEdge3 (False, False)
Part.ClearSelection2 True
End Sub
The problem is that this command requires you to select a point (surface / element) to convert. {Part.Extension.SelectByRay (3.05115602275068E-03, -1.92111892697995E-03, ...}
Is it possible to automate this process to select (without asking the user to click) an element to convert to the "all" type in an already open sketch? A point is unknown on other model.
The model is always single-body and the sketch plane is always parallel to the model view.