6 Replies Latest reply on Apr 27, 2018 8:34 AM by Alex Burnett

    select and delete drawing sheet

    Mark Blakey

      I for the life of me can not get api to delete a drawing sheet for me. I swear it worked before and now no longer. My "tests" show me that the sheet is not being selected for deletion. What am i doing wrong here?

       

      If strAssmOpen <> "YES" Then

                 

                  Set swDraw1 = swApp.OpenDoc6(AssemblyNameFile & ".slddrw", swDocDRAWING, 1, "default", assmWorked, lonWarning)

                      Set swSelMgr = swDraw1.SelectionManager

                      If strDoorStyle <> "HO" Then

                          swDraw1.ActivateSheet "HOLD OPEN DOOR INSTALLATION"

                          bSheetSelect = swDraw1.Extension.SelectByID2("HOLD OPEN DOOR INSTALLATION", "SHEET", 0.01, 0.01, 0, False, 0, Nothing, 0)

                              If bSheetSelect = True Then

                                  swDraw1.DeleteSelection (False)

                              Else

                                  swApp.SendMsgToUser2 "Trouble selecting hold open door sheet for deletion", swMbWarning, swMbOk

                              End If

                          swDraw1.ActivateSheet "HOLD OPEN MAGNET MOUNTING"

                          bSheetSelect = swDraw1.Extension.SelectByID2("HOLD OPEN MAGNET MOUNTING", "SHEET", 0.01, 0.01, 0, False, 0, Nothing, 0)

                              If bSheetSelect = True Then

                                  swDraw1.DeleteSelection (False)

                              Else

                                  swApp.SendMsgToUser2 "Trouble selecting hold open magnet sheet for deletion", swMbWarning, swMbOk

                              End If

                      End If

                     

                      If strAlcove = "YES" Then

                          bSheetSelect = swDraw1.ActivateSheet("SIDE PANEL INSTALLATION")

                          bSheetSelect = swDraw1.Extension.SelectByID2("SIDE PANEL INSTALLATION", swSelSHEETS, 0, 0, 0, False, 0, Nothing, 0)

                              If bSheetSelect = True Then

                                  swDraw1.Extension.DeleteSelection2 (0)

                              Else

                                  'swApp.SendMsgToUser2 "Trouble selecting side panel sheet for deletion", swMbWarning, swMbOk

                              End If

                      End If

              End If

       

      I tried the delete selection and now have moved to extension.deleteselection2 , Still no luck.