AnsweredAssumed Answered

How to use editsketch in DrawingDoc

Question asked by Yong Ning on Dec 12, 2016
Latest reply on Dec 12, 2016 by Yong Ning

Why use ActivateView , use  /SwDraw.EditSketch  → False

 

In DrawingDoc ,Follow  Code is don't EditSketch

 

Private Sub ll()

   Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

       Set SwApp = Application.SldWorks

       Set SwModel = SwApp.ActiveDoc

   Dim SwDraw As DrawingDoc

       Set SwDraw = SwModel

   Dim tmp, ViewName

       ViewName = "Drawing View1"

       tmp = SwModel.Extension.SelectByID2(ViewName, "DRAWINGVIEW", 0, 0, 0, True, 0, Nothing, 0)

       SwDraw.ActivateView ViewName

       Stop

       tmp = SwModel.Extension.SelectByID2("Broken-out Section1", "SECTIONLINE", 0, 0, 0, True, 0, Nothing, 0)

       SwDraw.EditSketch

End Sub

''

 

 

 

SketchEdit.jpg

 

 

Hope resul  is

SketchEdit1.jpg

 

2012 SOLIDWORKS API Help - Get Broken-Out Section Feature Data Example (VBA)  http://help.solidworks.com/2012/english/api/sldworksapi/get_broken_out_section_feature_data_example_vb.htm

 

2012 SOLIDWORKS API Help - Get Area Hatch Data Example (VBA)  http://help.solidworks.com/2012/english/api/sldworksapi/get_area_hatch_data_example_vb.htm

Outcomes