0 Replies Latest reply on Jan 6, 2017 7:48 AM by Yong Ning

    How to convert a point in a view to a point in a sketch

    Yong Ning

      Record MACRO,

      Select Point → X → -0.5

      boolstatus = Part.Extension.SelectByID2("Point42", "SKETCHPOINT", -0.5, -0.2510447260161, 0, False, 0, Nothing, 0)

      Select EDGE → X → 0.1446216745001

      boolstatus = Part.Extension.SelectByID2("", "EDGE", 0.1446216745001, 0.1024454966003, -4499.402892281, False, 0, Nothing, 0)

       

       

      ReferencePoints3.jpg

       

      Follow code SwPt.X → -0.5

       

      Private Sub ll()

         Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

             Set SwApp = Application.SldWorks

             Set SwModel = SwApp.ActiveDoc

         Dim SwSelMgr As SelectionMgr

             Set SwSelMgr = SwModel.SelectionManager

         Dim SwPt As SketchPoint

             Set SwPt = SwSelMgr.GetSelectedObject5(1)

             Debug.Print SwPt.X

      End Sub

       

      Help me, X → 0.1446216745001