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!

Catia Macro

Status
Not open for further replies.

vvk555

Automotive
Feb 24, 2017
1
US
Do anyone know how to create a macro to activate/deactivate a particular constraint in assembly? I tried to record the macro but it is not working.
 
Replies continue below

Recommended for you

Code:
Sub CATMain()

Dim productDocument1 As ProductDocument
Set productDocument1 = CATIA.ActiveDocument

Dim product1 As Product
Set product1 = productDocument1.Product

Dim constraints1 As Constraints
Set constraints1 = product1.Connections("CATIAConstraints")

Dim constraint1 As Constraint
Set constraint1 = constraints1.Item("Offset.1")

'---activate or deactivate---
constraint1.Deactivate
'constraint1.Activate

End Sub

Drew Mumaw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top