how to get the selected equipment object

we have used forge Viewer to display the BIM models. But if we click any equipment listed in the Tree Selecion, In the Forge Viewer equipment not Zooming.
Kindly help us to get the selected equipment Zooming in the Forge Viewer. Kindly share the sample code for our reference.

We have Used Below code:

Autodesk.Viewing.Initializer(options, function () {
         // Get the viewer div
         const viewerDiv = document.getElementById('forgeViewer');

         // Initialize the viewer object
         const viewer = new Autodesk.Viewing.GuiViewer3D(viewerDiv);
         viewer.start();

         // Ensure event listeners are added only once
         viewer.addEventListener(Autodesk.Viewing.TOOLBAR_CREATED_EVENT, onToolbarCreated);
         viewer.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT, Loadedevent);

         // Initialize the AggregatedView
         const view = new Autodesk.Viewing.AggregatedView();
         view.init(viewerDiv, options3d);

         // Use the same viewer instance
         const aggregatedViewer = view.viewer; 

         // Set custom profile settings
         const customProfileSettings = {
             settings: {
                 reverseMouseZoomDir: true,
                 reverseHorizontalLookDirection: true,
                 selectionMode: 1 // enum value, 0 is default 'First Object' is 1
             }
         };

         const customProfile = new Autodesk.Viewing.Profile(customProfileSettings);
         viewer.setProfile(customProfile);
 
         // Optimize viewer settings
         viewer.setQualityLevel(false, false); // Disable ambient occlusion and antialiasing
         viewer.setGroundShadow(false); // Disable ground shadow
         viewer.setGroundReflection(false); // Disable ground reflection
         viewer.setProgressiveRendering(true); // Enable progressive rendering
 
         // Load all manifests
         const tasks = models.map(md => loadManifest(md.urn, aggregatedViewer)); 
         Promise.all(tasks)
             .then(docs => Promise.resolve(docs.map(doc => {
                 const bubbles = doc.getRoot().search({ type: 'geometry', role: '3d' });
                 const bubble = bubbles[0];
                 if (!bubble) return null;
                 return bubble;
             })))
             .then(bubbles => view.setNodes(bubbles));
     });
 
     // loadManifest function

     function loadManifest(documentId, viewer) {
         debugger;
         return new Promise((resolve, reject) => {
             const onDocumentLoadSuccess = (doc) => {
                 doc.downloadAecModelData(() => resolve(doc));

                 // New code for handling selection changes
                 viewer.addEventListener(Autodesk.Viewing.AGGREGATE_SELECTION_CHANGED_EVENT, (event) => {
                    if (!event.selections || event.selections.length <= 0 || event.selections.length > 1) return; 
                     const selSet = event.selections[0];
                     const dbIds = selSet.dbIdArray;
                     const model = selSet.model;
                     const dbId = dbIds[0];
 
                     model.getProperties(dbId, function (data) {
                         if (FromPage == '') {
                             if (FromSelection == '') {
                                 if (Count === 0) {
                                     let instanceTree = model.getInstanceTree();
                                     let parentId = instanceTree.getNodeParentId(dbId);
                                     var objectid = parentId + 1;
                                     if (objectid === PreviousParentId) {
                                         Count = 1;
                                         selectionchangecount = 0;
                                     } else {
                                         viewer.select(parentId, model, Autodesk.Viewing.SelectionType.OVERLAYED);
                                         // or viewer.setAggregateSelection([ { ids: [parentId ], model, selectionType: Autodesk.Viewing.SelectionType.OVERLAYED } ])
                                         Count = 1;
                                         selectionchangecount = 0;
                                     }
                                     PreviousParentId = parentId;

                                 } else {
                                     itemobject = dbId;
                                     selectionchangecount = selectionchangecount + 1;
                                     if (selectionchangecount == fileselectioncount) {
                                         Count = 0;
                                         selectionchangecount = 0;
                                     }
                                 }
                             } else {
                                 selectionchangecount = selectionchangecount + 1;
                                 if (selectionchangecount == filecount) {
                                     FromSelection = '';
                                     selectionchangecount = 0;
                                 }
                                 itemobject = dbId;
                             }
                         } else {
                             FromPage = '';
                             itemobject = dbId;
                         }

                     });
                 });
             };
 
             Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, reject);
         });
     }

need Solution for Zooming the equipment.

New contributor

E.M Pradeep is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

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