1 Reply Latest reply on Apr 27, 2017 7:12 AM by Peter Brinkhuis

    CreateUnfoldedViewAt3→Alignment is error?

    Yong Ning




                              Set SwView = SwDraw.CreateDrawViewFromModelView3(ModelName, ViewName, Xx, Yy, 0)

                              Tmp = SwModel.Extension.SelectByID2(SwView.Name, "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 0)

                              Set SwView = SwDraw.CreateUnfoldedViewAt3(Xx, Yy, 0, False)


      result is Alignment is error.






      Sub LS1()

          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 SwView As View, SwView1 As View

              boolstatus = SwModel.Extension.SelectByID2("鞍座S主视图", "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 0)

              Set SwView = SwSelMgr.GetSelectedObject5(1)


              boolstatus = SwModel.Extension.SelectByID2("鞍座S视图", "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 1)

              Set SwView1 = SwSelMgr.GetSelectedObject5(1)


              boolstatus = SwView1.AlignWithView(2, SwView)



      End Sub

        • Re: CreateUnfoldedViewAt3→Alignment is error?
          Peter Brinkhuis

          I see two code snippets that's aren't finished, how are you really using it?


          CreateUnfoldedView uses the coordinates you enter to determine which view it places, so if you add something to the Y coordinate of the main view it will create a top view. What are the coordinates you are using? If you're using Xy and Yy for both the main view and projected view, I can imagine the results aren't great.