Selecting all Entities
Selecting all Entities
(OP)
Hi,
I was trying to select all entities in a SolidWorks drawing through SolidWorks API.
The drawing has been created from a dxf.
I searched for a method for window selection, I think its not avaialble.
Can someone has steps to do such selection.
Regards,
Vinay
I was trying to select all entities in a SolidWorks drawing through SolidWorks API.
The drawing has been created from a dxf.
I searched for a method for window selection, I think its not avaialble.
Can someone has steps to do such selection.
Regards,
Vinay






RE: Selecting all Entities
Please refer the following macro:
- - - - - - - - -
Dim swApp As SldWorks.SldWorks
Dim swDraw As SldWorks.DrawingDoc
Dim swView As SldWorks.View
Dim swSketch As SldWorks.Sketch
Dim vSegs As Variant
Dim swSkSeg As SldWorks.SketchSegment
Dim i As Integer
Sub main()
Set swApp = Application.SldWorks
Set swDraw = swApp.ActiveDoc
Set swView = swDraw.GetFirstView
Set swSketch = swView.GetSketch
vSegs = swSketch.GetSketchSegments
For i = 0 To UBound(vSegs)
Set swSkSeg = vSegs(i)
swSkSeg.Select4 True, Nothing
Next
End Sub
- - - - - - - - -
BTW. You can also perform a window selection using IMouse interface. You can simulate mouse clicks from one corner to another opposite one so it will looks like 'real' selection
Artem Taturevich
CSWP
RE: Selecting all Entities
Artem Taturevich
CSWP
RE: Selecting all Entities
Your VB code will help me.
RE: Selecting all Entities
Actually I wanted to move all entities to one layer.
I selected all entities but now I am facing difficulty to find a method to move all entities to one layer.
I try to make the desired layer active after selecting, but its not working.
RE: Selecting all Entities
Artem Taturevich
CSWP