Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations 3DDave on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help for Macros that "scanns" the CATdrawing sheet to get Part Number and Drawing sheet no.

aerostudent2618

Aerospace
May 28, 2025
2
Hi everyone im a newbie to catia,
I have very little coding C++


Problem statement:

Im doing this project where by its difficult to find where a specfic part is located in which sheet. The part can be located in different drawing sheets or only 1.

My potential solution: i was think of using vba codes to run a macro that would scan the sheet and extract the part number and its associated drawing sheet.

Help: i need advice or the code that would work, should be using BOM, or vba code is good? I really need your help.thankssss
 
Replies continue below

Recommended for you

A common approach to do it with VBA:
1. Enable color inheritance for drawing views
2. Color the part uniquely
3. Update views
4. Use Selection.Search to find generated geometry of the color chosen in step 2.

In C++ you do it by retrieving CATIDftGenRequest from view that yields a set of CATIDftGenItem each representing single generated geometry feature which can be further used to get original product with GetProduct()
 

Part and Inventory Search

Sponsor