2 Replies Latest reply on Apr 8, 2014 9:24 AM by Luigi Piron

    HOW TO SELECT A FEATURE (SKETCH) IN A MODEL AND Convert IT TO A DRAWING VIEW

    Luigi Piron

      hallo to everybody

       

      i need some advices , my proposal is:

       

      start with a drawing model opened

      select a drawing view where i want to projet a sketch

      select a sketch named GG that is placed inside the model and convert it to a sketch inside a view selected


      Dim swApp As SldWorks.SldWorks
      Dim swModel As SldWorks.ModelDoc2

       

      Dim swDraw As SldWorks.DrawingDoc
      Dim swSelMgr As SldWorks.SelectionMgr

      Dim swView As SldWorks.View

       

      Dim boolstate As Boolean

       

      Dim feat As SldWorks.Feature


      Sub main()

       

          Set swApp = Application.SldWorks
          Set swModel = swApp.ActiveDoc 
          Set swDraw = swModel          
         
          Set swSelMgr = swModel.SelectionManager
          Set swView = swSelMgr.GetSelectedObject6(1, -1)
         
          Set feat = swDraw.FeatureByName("GG")
          feat.Select4 False, Nothing
         
          boolstate = swView.SketchManager.SketchUseEdge2(False)

       

      any suggestion ??

      thank you

       

      Luigi