0

I'm attempting to change attributes in Catia on an active selection only. I'm looking to take this code and generalize it so that instead of targeting 1 specific item, it will activate the macro on whatever item I have selected.

Sub CATMain()

    Dim documents1 As Documents
    Set documents1 = CATIA.Documents

    Dim partDocument1 As PartDocument
    Set partDocument1 = documents1.Item("Test 1.CATPart")

    Dim product1 As product
    Set product1 = partDocument1.GetItem("Test 1")

    product1.Revision = "test"

    product1.Definition = "yo"

End Sub

Thank you for you help.

freeflow
  • 4,129
  • 3
  • 10
  • 18
aaron
  • 81
  • 1
  • 10

1 Answers1

0

Answered my own question...

Sub CATMain()

    Dim objSel As Selection
    Set objSel = CATIA.ActiveDocument.Selection

    objSel.Item(1).Value.ATTRIBUTE = "hi"

End Sub

This changes the desired attributes of the selected item.

Radogost
  • 143
  • 5
  • 16
aaron
  • 81
  • 1
  • 10