Let’s Start Programming! Forums CATIA Macro Programming List.add(itemValue As AnyObject)

This topic contains 1 reply, has 2 voices, and was last updated by  Matt 2 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1604

    Escore
    Participant

    Hey, I am working with CATIA V5 R19 (catvba) and I am trying to make a list inside a list. The first list shall (for example) contain the names of the persons and the list inside this list shall contain their age and sex.

    I am trying to use:

    This is what intellisense suggests inside the brackets: “itemValue As AnyObject”. I just cant get it to work. Runtime Error 91, does not matter if i put a string inside the brackets or an integer.

    I would be very thankful for help, since I need this for work. I dont like Collections because you can’t change an item without removing it and adding it again. Also I want the whole code in one single .txt document (so no extra classes on different pages).

    Thank you a lot!

    #1703

    Matt
    Participant

    What type of List is this? I cannot find the type List in VBA. Is this a CATIA list that appears under parameters once created?

    To manually add a feature to a CATIA List, you have to select it then select the add button. Maybe try repeating the manual steps in your macro…

    CATIA.ActiveDocument.Selection.Add oFeature
    oList.Add CATIA.ActiveDocument.Selection.Item(1).value
    CATIA.ActiveDocument.Selection.Clear

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘CATIA Macro Programming’ is closed to new topics and replies.