Page 1 of 1

Convert Entities

Posted: Wed Feb 09, 2022 1:49 pm
by SPerman
Is it possible to have Convert Entities convert the entire face at once? I always have to run the command at least twice if there is an inner loop. (And if I do the outer loop first, I have to select the inner edges one at a time. I can't just select the face.)

Re: Convert Entities

Posted: Wed Feb 09, 2022 1:51 pm
by Alin
If it is a planar face, coincident to the sketch plane, use the Intersection Curve.

Re: Convert Entities

Posted: Wed Feb 09, 2022 1:52 pm
by Alin
Also this:

Image

Image
image.png

Re: Convert Entities

Posted: Wed Feb 09, 2022 2:01 pm
by SPerman
That gives me the inner loops, but I have to run the command again to get the outer loops. Am I doing it wrong? (click on GIF below)
convert.gif

Re: Convert Entities

Posted: Wed Feb 09, 2022 2:18 pm
by Alin
SPerman wrote: Wed Feb 09, 2022 2:01 pm That gives me the inner loops, but I have to run the command again to get the outer loops. Am I doing it wrong? (click on GIF below)

convert.gif
Try to check the box first.

Image

Re: Convert Entities

Posted: Wed Feb 09, 2022 2:36 pm
by SPerman
That still only selects the inner loop for me. (2020 SP5)

Re: Convert Entities

Posted: Wed Feb 09, 2022 2:37 pm
by Alin
SPerman wrote: Wed Feb 09, 2022 2:36 pm That still only selects the inner loop for me. (2020 SP5)
But you have only one inner loop.

Re: Convert Entities

Posted: Wed Feb 09, 2022 2:38 pm
by Alin
SPerman wrote: Wed Feb 09, 2022 2:36 pm That still only selects the inner loop for me. (2020 SP5)
Send me the file, please.

Re: Convert Entities

Posted: Wed Feb 09, 2022 2:40 pm
by SPerman
I want it to select the inner and outer loops at the same time.

Re: Convert Entities

Posted: Thu Feb 10, 2022 2:50 am
by Frank_Oostendorp
Alin wrote: Wed Feb 09, 2022 2:18 pm Try to check the box first.

Image
I am curious as well, is there a way to select all loops (inner and outer) to convert their entities to a sketch, Alin?

Re: Convert Entities

Posted: Thu Feb 10, 2022 3:55 am
by RonE
I think currently the UI doesn't provide a way to do it but API does. :D

Code: Select all

Option Explicit

Sub main()

    Dim swApp As SldWorks.SldWorks
    Dim swModel As ModelDoc2
    Dim swSelMgr As SelectionMgr
    Dim swFace As Face2
    Dim EdgeArr() As Edge
    Dim swSketch As Sketch
    Dim swSketchManager As SketchManager

    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    
    If swModel Is Nothing Then Exit Sub
    
    Set swSketch = swModel.GetActiveSketch2
    Set swSketchManager = swModel.SketchManager
    Set swSelMgr = swModel.SelectionManager
    If swSelMgr.GetSelectedObjectType3(1, -1) = swSelectType_e.swSelFACES Then
        Set swFace = swSelMgr.GetSelectedObject6(1, -1)
    End If
    
    If swSketch Is Nothing Then Exit Sub
    If swFace Is Nothing Then Exit Sub

    EdgeArr = swFace.GetEdges
    If IsEmpty(EdgeArr) Then Exit Sub
    
    swModel.Extension.MultiSelect2 EdgeArr, False, Nothing
    
    swSketchManager.SketchUseEdge2 False

End Sub

Re: Convert Entities

Posted: Thu Feb 10, 2022 8:45 am
by DanPihlaja
Alin wrote: Wed Feb 09, 2022 2:37 pm But you have only one inner loop.
He is trying to grab both the inner loops and the outer loops at the same time

Re: Convert Entities

Posted: Thu Feb 10, 2022 8:47 am
by Alin
Alin wrote: Wed Feb 09, 2022 2:18 pm Try to check the box first.

Image
I stand corrected. The Property manager reports all entities are selected, but the command converts only the inner contours. o[

Re: Convert Entities

Posted: Thu Feb 10, 2022 8:49 am
by Alin
So, the current solution is to run Intersection Curve instead of Convert Entities. It will capture all edges that are laying on the sketch plane.

It is also a much more robust feature than Convert Entities. If new holes are added on that face, they will be automatically captured by a rebuild operation.

Re: Convert Entities

Posted: Thu Feb 10, 2022 9:27 am
by SPerman
Alin wrote: Thu Feb 10, 2022 8:49 am So, the current solution is to run Intersection Curve instead of Convert Entities. It will capture all edges that are laying on the sketch plane.

It is also a much more robust feature than Convert Entities. If new holes are added on that face, they will be automatically captured by a rebuild operation.
That's great to know. I will use that in the future.