AnsweredAssumed Answered

Macro for intersection curve on define no of plane

Question asked by Vishal Pambhar on Jul 6, 2013

Hi...

 

     PLease help me for the macro.Please refer my macro bleow..i would like to take intersection curve for plane 1 to 200 for that i have used FOR loop in the macro..but it is not working. as i am new with the vb .So please help..

 

Dim swApp As Object

 

 

Dim Part As Object

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

Dim i As Integer

 

Sub main()

Set swApp = _

Application.SldWorks

 

 

Set Part = swApp.ActiveDoc

For i = 1 To 200

    boolstatus = Part.Extension.SelectByID2("Plane(i)", "PLANE", 0, 0, 0, False, 0, Nothing, 0)

    Part.SketchManager.InsertSketch True

    Part.Sketch3DIntersections

    boolstatus = Part.Extension.SelectByID2("WEB datum-2", "SURFACEBODY", 0, 0, 0, True, 0, Nothing, 0)

    boolstatus = Part.Extension.SelectByID2("Imported1", "SOLIDBODY", 0, 0, 0, True, 0, Nothing, 0)

    Part.Sketch3DIntersections

    Part.ClearSelection2 True

    Part.Sketch3DIntersections

    Part.ClearSelection2 True

    Part.SketchManager.InsertSketch True

Next i

End Sub

Outcomes