3d sketch point

hello

any suggestion how to edit point in 3d sketch using API

like i created a point at (0.05,0.05,0.05) in 3d sketch but then using API i want to update it to (0.07,0.07,0.07)

SolidworksApi macros
Answers 4
AT
AT 2014-04-02 Best Answer

You need to get the pointer to your point (for example ISketch::GetSketchPoints to get all points in the sketch). After just call the ISketchPoint::X, ISketchPoint::Y and ISketchPoint::Z to change the location.

SF
SF 2014-04-02

thanku sir

but could you post the api code taking any example

AT
AT 2014-04-03

Here is the simple example:

<p>Dim swApp As SldWorks.SldWorks</p><p>Dim swModel As SldWorks.ModelDoc2</p><p></p><p>Sub main()</p><p></p><p>    Set swApp = Application.SldWorks</p><p></p><p>    Set swModel = swApp.ActiveDoc</p><p>    </p><p>    swModel.SketchManager.Insert3DSketch True</p><p>    swModel.SketchManager.AddToDB = True</p><p>    </p><p>    Dim swSkPoint As SldWorks.SketchPoint</p><p>    </p><p>    Set swSkPoint = swModel.SketchManager.CreatePoint(0.05, 0.05, 0.05)</p><p>    </p><p>    swModel.SketchManager.AddToDB = False</p><p>    swModel.SketchManager.Insert3DSketch True</p><p>        </p><p>    swSkPoint.GetSketch().Select2 False, 0</p><p>    </p><p>    swModel.EditSketch</p><p>    </p><p>    swSkPoint.X = 0.1</p><p>    swSkPoint.Y = 0.1</p><p>    swSkPoint.Z = 0.1</p><p>    </p><p>    swModel.SketchManager.Insert3DSketch True</p><p>        </p><p>End Sub</p>

______________________________________________

Regards, Artem Taturevych | Snr. Developer | IC3D ANZ

IC3DSteel – New Steel Solution for SolidWorks

translationXpert – SolidWorks files language translator

LinkedIn - SolidWorks API Group

SF
SF 2014-04-03

thank you sir,

this example really works and my problem is solved...

thank you so much