Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How Can Delete Product Description With Macro

Proportions

Aerospace
Mar 24, 2025
2
I want to remove all unnecessary descriptions in the description section of the assembly files. I want it to do this for all sub-parts at once with a macro. Is this possible?
I have hundreds of sub parts.

Thank you!

1742846779913.jpeg
 
Replies continue below

Recommended for you

You can use recursion with a VBA macro to iterate through each Product in your assembly and clear its description property. Here is my code

Code:
Sub Main()
    Dim doc As ProductDocument
    Set doc = CATIA.ActiveDocument
    
    Dim rootPrd As Product
    Set rootPrd = doc.Product
    
    ClearDescription rootPrd
End Sub

Sub ClearDescription(prd As Product)
    prd.DescriptionInst = ""
    Dim subPrd As Product
    For Each subPrd In prd.Products
        ClearDescription subPrd
    Next
End Sub
 
You can use recursion with a VBA macro to iterate through each Product in your assembly and clear its description property. Here is my code

Code:
Sub Main()
    Dim doc As ProductDocument
    Set doc = CATIA.ActiveDocument
   
    Dim rootPrd As Product
    Set rootPrd = doc.Product
   
    ClearDescription rootPrd
End Sub

Sub ClearDescription(prd As Product)
    prd.DescriptionInst = ""
    Dim subPrd As Product
    For Each subPrd In prd.Products
        ClearDescription subPrd
    Next
End Sub

That solution is awasome! Thank you so much!
 

Part and Inventory Search

Sponsor