7 Replies Latest reply on Jun 7, 2017 2:28 AM by Cloud Strife Pom Cloud Strife Pom

    How do I call out a Direction Vector in a Swept Surface in my macro?

    Ryan Hatzung

      Hello all;

      I am currently trying to sweep a surface along a path and include a direction vector to level out the surface.

      This is what Solidworks recorded:

       

      Part.ClearSelection2 True

      boolstatus = Part.Extension.SelectByID2("TP SURF PROF", "SKETCH", 1.6794728349689E-03, -7.49516802382813E-03, 0, False, 1, Nothing, 0)

      boolstatus = Part.Extension.SelectByID2("CENTERLINE", "SKETCH", 0, 0, -0.014091549503064, True, 4, Nothing, 0)

      boolstatus = Part.Extension.SelectByID2("Line1@VERT REF", "EXTSKETCHSEGMENT", 6.03070077598301E-02, 0.128785829516555, -0.2479, True, 128, Nothing, 0)

      Dim myFeature As Object

      Set myFeature = Part.FeatureManager.InsertSweepSurface2(False, 0, False, False, 1, 1, 2, True, True, 0, True)

      Part.ClearSelection2 True

       

       

      And this is how I adapted it to my Macro:

          Dim TpSurfSwp As Object

          objPart.ClearSelection2 True

       

          blnstatus = objPart.Extension.SelectByID2("TP SURF PROF", "SKETCH", skpMtScrapEnd.X, skpMtScrapEnd.Y, skpMtScrapEnd.Z, False, 1, Nothing, 0)

          blnstatus = objPart.Extension.SelectByID2("CENTERLINE", "SKETCH", 0, 0, 0, True, 4, Nothing, 0)

          blnstatus = objPart.Extension.SelectByID2("Line1@VERT REF", "EXTSKETCHSEGMENT", 0, 0, 0, True, 128, Nothing, 0)

       

          Set TpSurfSwp = objPart.FeatureManager.InsertSweepSurface2(False, 0, False, False, 1, 1, 2, True, True, 0, True)

       

      The surface will sweep without a problem, but it does not include the direction vector.

      Any Ideas on what the issue is?

       

      Thanks in advance;

      Ryan