Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Activate Terminal Node over entire CATProduct

Status
Not open for further replies.

CheeseMaker13

Aerospace
Sep 25, 2012
42
GB
I need to be able to apply "Activate Terminal Node" over an entire product, but currently I can't work out to get everything (including those parts buried two levels deep in 'components' to load.


I've tried to do it via each first level product, which works apart from no parts in components are loaded:

Code:
    Set CATIA_Product = CATIA.Documents.Open("Path to File".CATProduct")
    Set CATIA_Products = CATIA_Product.Product.Products
    
    CATIA_Product.Activate
    CATIA_Product.Product.ApplyWorkMode (DESIGN_MODE)
        
    Product_Count = CATIA_Products.Count
    
    For i = 1 To Product_Count
        CATIA_Products.Item(i).ActivateDefaultShape
    Next


I've also tried:

Code:
    Set CATIA_Product = CATIA.Documents.Open("Path to File".CATProduct")
    Set CATIA_Products = CATIA_Product.Product.Products
    
    CATIA_Product.Activate
    CATIA_Product.Product.ApplyWorkMode (DESIGN_MODE)
    CATIA_Products.ActivateDefaultShape


And a few other combos without success.

Peoples thoughts?
 
Replies continue below

Recommended for you

Hi, absolute top node!

Assembly
- Component (Part 1)
- Component (Part 2)
- Component (Part 3)
- Component (Product 1)
- Component
-- Component (Part 1 - Part 2 bolts)
--- Bolt 1
--- Bolt 2
--- Bolt 3
-- Component (Part 2 - Part 3 bolts)
--- Bolt 1
--- Bolt 2
--- Bolt 3
-- Component (Part 3 - Product 1 bolts)
--- Bolt 1
--- Bolt 2
--- Bolt 3

If that explains it?

So I guess yes, top node!
 
Hi Mate,

Thanks, but still not working/nothing happening!!



Getting "Object does not support this property or method", error 438.

Code:
    Set Excel_Sheet = Excel_Workbook.Worksheets(Control_Sheet)
    
    Set CATIA_Product = CATIA.Documents.Open("PATH" & Excel_Sheet.Cells(iRow, Part_Number_Column) & ".CATProduct")
    Set CATIA_Products = CATIA_Product.Product.Products
    
    Dim CATIA_Selection As Selection
    Set CATIA_Selection = CATIA.ActiveDocument.Selection

    ' clear selection
    CATIA_Selection.Clear

    ' select root product
    CATIA_Selection.Add CATIA.ActiveDocument.Product
    
    CATIA_Selection.ActivateDefaultShape
 
In a CATScript, for me is working.

Sub CATMain()

Dim objSelection as Selection
Set objSelection = CATIA.ActiveDocument.Selection

' clear selection
objSelection.Clear

' select root product
objSelection.Add CATIA.ActiveDocument.Product

CATIA.StartCommand "Activate Terminal Node"


End Sub


Regards
Fernando

 
Thanks mate, that works perfectly now!!

Just need to sort the problem out with my clash exporter (see other thread!).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top