How do I get my v7 APS viewer toolbar to not remove buttons when the viewer window changes? Why arent my zoom and section buttons working?

I have a next.js app using v7 of the APS Viewer. At the size that we want the window to display, several buttons on the toolbar are missing. Make it wider, they reappear. The only way I’ve found to stop this is to remove these buttons, and re-add them. However, when I do this, some of them do not work anymore. What am I doing wrong, and do I need to do this at all? Eventually, I want to add extension functionality to custom buttons, but it is not at all clear how to do this from the documentation.

I set up an event listener to pull the toolbar, and pull out each of the toolbar groups. I’ve listed the tools on each toolbar group barbarian style and then removed them all. I then try to re-add them. This has given me the permanent buttons I want, but I don’t see why Zoom doesn’t work and I’ve totally lost the collapsable button for the section tool.

What am I doing wrong, and how do I do this better?

newViewer.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT, () => {
      newViewer.fitToView();

      const toolbar = newViewer.toolbar;

      // define then list the contents of the navTools group
      const navTools = toolbar.getControl("navTools");
      console.log("navTools: ", navTools);
      let firstToolId = navTools.getControlId(0);
      console.log("1stToolId: ", firstToolId);
      let secondToolId = navTools.getControlId(1);
      console.log("2ndToolId: ", secondToolId);
      let thirdToolId = navTools.getControlId(2);
      console.log("3rdToolId: ", thirdToolId);
      let fourthToolId = navTools.getControlId(3);
      console.log("4thToolId: ", fourthToolId);
      let fifthToolId = navTools.getControlId(4);
      console.log("5thToolId: ", fifthToolId);

      // remove the tools so we can repopulate them
      navTools.removeControl("toolbar-orbitTools");
      navTools.removeControl("toolbar-panTool");
      navTools.removeControl("toolbar-zoomTool");
      navTools.removeControl("toolbar-bimWalkTool");
      navTools.removeControl("toolbar-cameraSubmenuTool");

      // define then list the contents of the modelTools group
      const modelTools = toolbar.getControl("modelTools");
      console.log("modelTools: ", modelTools);
      let firstModelToolId = modelTools.getControlId(0);
      console.log("1stToolId: ", firstModelToolId);
      let secondModelToolId = modelTools.getControlId(1);
      console.log("2ndToolId: ", secondModelToolId);
      let thirdModelToolId = modelTools.getControlId(2);
      console.log("3rdToolId: ", thirdModelToolId);
      let fourthModelToolId = modelTools.getControlId(3);
      console.log("4thToolId: ", fourthModelToolId);
      let fifthModelToolId = modelTools.getControlId(4);
      console.log("5thToolId: ", fifthModelToolId);

      //remove the tools so we can repopulate them
      modelTools.removeControl("toolbar-explodeTool");
      // modelTools.removeControl("toolbar-sectionTool");
      let sectionTool = modelTools.getControl("toolbar-sectionTool");
      console.log("sectionTool: ", sectionTool);

      let orbitButton = new Autodesk.Viewing.UI.Button("orbitToolButton");
      orbitButton.onClick = function () {
        newViewer.setActiveNavigationTool("orbit");
      };
      orbitButton.setToolTip("Orbit");
      orbitButton.setIcon("adsk-icon-orbit-constrained");

      let controlGroup = toolbar.getControl("navTools"); // You can use an existing group like navTools
      controlGroup.addControl(orbitButton);

      let panButton = new Autodesk.Viewing.UI.Button("panToolButton");
      panButton.onClick = function () {
        newViewer.setActiveNavigationTool("pan");
      };
      panButton.setToolTip("Pan");
      panButton.setIcon("adsk-icon-pan");
      controlGroup.addControl(panButton);

      // zoom dosent work
      let zoomButton = new Autodesk.Viewing.UI.Button("zoomToolButton");
      zoomButton.onClick = function () {
        newViewer.setActiveNavigationTool("zoom");
      };
      zoomButton.setToolTip("Zoom");
      zoomButton.setIcon("adsk-icon-zoom");
      controlGroup.addControl(zoomButton);

      let fitToViewButton = new Autodesk.Viewing.UI.Button(
        "fitToViewToolButton"
      );
      fitToViewButton.onClick = function () {
        newViewer.fitToView();
      };
      fitToViewButton.setToolTip("fitToView");
      fitToViewButton.setIcon("adsk-icon-fit-to-view");
      controlGroup.addControl(fitToViewButton);

      let firstPersonButton = new Autodesk.Viewing.UI.Button(
        "firstPersonToolButton"
      );
      firstPersonButton.onClick = function () {
        newViewer.setActiveNavigationTool("bimwalk");
      };
      firstPersonButton.setToolTip("First Person");
      firstPersonButton.setIcon("adsk-icon-first-person");
      controlGroup.addControl(firstPersonButton);
      //model tool group
      let modelGroup = toolbar.getControl("modelTools");

      // dosent work
      let sectionAnalysisButton = new Autodesk.Viewing.UI.Button(
        "sectionAnalysisToolButton"
      );
      sectionAnalysisButton.onClick = function () {
        newViewer.setActiveNavigationTool("section");
      };
      sectionAnalysisButton.setToolTip("Section Analysis");
      sectionAnalysisButton.setIcon("adsk-icon-section-analysis");
      modelGroup.addControl(sectionAnalysisButton);
    });

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật