Is there a way to mass convert points from a 3D sketch to a 2D sketch? Currently I have to click on each point to convert. Copy and paste also does not work properly.

Thanks

Is there a way to mass convert points from a 3D sketch to a 2D sketch? Currently I have to click on each point to convert. Copy and paste also does not work properly.

Thanks

At least in SW 2014, I can't select Insert>Derived Sketch, because it is grayed out. That would be a handy feature to have. Is it available in a later version?

Did you select the sketch and a sketch plane, you need to make those selections or one of them for it to clear the grayout..

EDITED - Derived sketch doesn't work when using a 3D sketch - however it works for 2D sketch

I tried that and in 2014 it doesn't give that option. Is that only available in 2017, or is it in 2016 SP5? The reason I'm asking is we are looking at upgrading and if it is in 2017, it may help sway me to wait until they get 2017 more stable and jump to that release. Right now we are leaning toward 2016 SP5.

Matt Peneguy - I should have checked before I posted, 2D sketch is available for a derived sketch , but not a 3D sketch (2017 SP3)

Hi Rod

I would say you need a macro, for a similar situation (model vertices -> sketch points) I wrote my first one, took me all day but it puts a smile on your face when it works.

As I was trying I made one that copies points from "Sketch1" to "Sketch2". In it's current form it isn't very useful, I was just learning and this was a stepping stone. I would you suggest you ask in the api forum?

Here is what I wrote/copy/pasted/cannibalised...

'---------------------------------------------

Option Explicit

Dim swApp As SldWorks.SldWorks

Dim selMgr As SldWorks.SelectionMgr

Dim Model As SldWorks.ModelDoc2

Dim SketchPoints As Variant

Dim SketchFeature As SldWorks.Feature

Dim skPoint As Object

Dim boolstatus As Boolean

Dim i As Integer

Sub main()

Set swApp = CreateObject("SldWorks.Application")

Set Model = swApp.ActiveDoc

Set selMgr = Model.SelectionManager

Model.ClearSelection2 True

boolstatus = Model.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)

Model.SketchManager.InsertSketch True

Model.ClearSelection2 True

boolstatus = Model.Extension.SelectByID2("Sketch1", "SKETCH", 0, 0, 0, False, 0, Nothing, 0)

Set SketchFeature = selMgr.GetSelectedObject6(1, 0)

Set SketchFeature = SketchFeature.GetSpecificFeature2

SketchPoints = SketchFeature.GetSketchPoints2

For i = 0 To UBound(SketchPoints)

Set skPoint = Model.SketchManager.CreatePoint(SketchPoints(i).X, SketchPoints(i).Y, 0#)

Next i

Model.ClearSelection2 True

boolstatus = Model.Extension.SelectByID2("Sketch2", "SKETCH", 0, 0, 0, False, 0, Nothing, 0)

Set SketchFeature = selMgr.GetSelectedObject6(1, 0)

Set SketchFeature = SketchFeature.GetSpecificFeature2

SketchPoints = SketchFeature.GetSketchPoints2

For i = 0 To UBound(SketchPoints)

Set skPoint = Model.SketchManager.CreatePoint(SketchPoints(i).X, SketchPoints(i).Y, 0#)

Next i

Model.SketchManager.InsertSketch True

Model.ClearSelection2 True

End Sub

edit: actually my memories failing me,,, I think this is trying to copy 2 sketches worth of points, I can't remember, it did work kindof at the time

Could you use the macro provided here: Tutorial-How to export points from solidworks to a excel file! - GrabCAD

To export your 3D points to excel? Then change the Z column to all one value, then save the excel file as a txt file and then re-import it into Solidworks.

Tutorial-How to import points to solidworks from a text file ! - GrabCAD

Can you get away with doing an on plane relation with all the points?.. In my example I edited a 3d sketch where I had randomly created 3d sketch points, then selected the plane I wanted to make an on plane relation, then box selected the points. Don't know why I had to select the plane first, but I did.

Good Luck Rod, I would be interested in the macro myself so will look out for it

I just hastily cobbled this together, which creates a sketch on front plane and adds points at the origin and then makes them coincident with each point in 3DSketch1, but you have to turn off 'snapping manually' I don't know how do that

Option Explicit

Dim swApp As SldWorks.SldWorks

Dim selMgr As SldWorks.SelectionMgr

Dim Model As SldWorks.ModelDoc2

Dim SketchPoints As Variant

Dim SketchFeature As SldWorks.Feature

Dim skPoint As Object

Dim boolstatus As Boolean

Dim i As Integer

Sub main()

Set swApp = CreateObject("SldWorks.Application")

Set Model = swApp.ActiveDoc

Set selMgr = Model.SelectionManager

Model.ClearSelection2 True

boolstatus = Model.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)

Model.SketchManager.InsertSketch True

Model.ClearSelection2 True

boolstatus = Model.Extension.SelectByID2("3DSketch1", "SKETCH", 0, 0, 0, False, 0, Nothing, 0)

Set SketchFeature = selMgr.GetSelectedObject6(1, 0)

Set SketchFeature = SketchFeature.GetSpecificFeature2

SketchPoints = SketchFeature.GetSketchPoints2

For i = 0 To UBound(SketchPoints)

Set skPoint = Model.SketchManager.CreatePoint(0, 0, 0#)

boolstatus = SketchPoints(i).Select4(False, selMgr)

boolstatus = skPoint.Select4(True, selMgr)

Model.SketchAddConstraints "sgCOINCIDENT"

Next i

Model.SketchManager.InsertSketch True

Model.ClearSelection2 True

End Sub

It is not ideal, but might work for your situation. If you can link all of the points with lines then you can select the 3 sketch and convert the entities and then convert all of the entities to construction geometry? Would this be suitable or your situation? if not could you please provide more details on the context of the situation.

Thanks