Let’s Start Programming! Forums CATIA Macro Programming Product Engineering Optimizer VBA Code?

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

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

    tnicusan
    Participant

    Hi,

    I have a product with multiple catparts and in each I’m using a number of optimizations from Product Engineering Optimizer. (see photo)

    I would like to be able to run all of them with a single command.

    Any ideas?
    Thank you

    Attachments:
    #2313

    Matt
    Participant

    you need to loop through them all and run the. i found this on a french website.

    ODE:

    Sub Launch_optim()

    Dim analysisDocument1 As AnalysisDocument
    Dim selection1 As Selection
    Dim analysisManager1 As AnalysisManager
    Dim analysisModels1 As AnalysisModels

    Set analysisDocument1 = CATIA.ActiveDocument
    Set analysisManager1 = analysisDocument1.Analysis
    ‘checkname = analysisManager1.Name

    Dim optim1 As Optimization

    Set analysisModels1 = analysisManager1.AnalysisModels

    For i = 2 To 12
    Set optim1 = analysisManager1.Relations.Optimizations.Item(i) ‘selecting the optimization function already set up
    ‘checkname = optim1.Name ‘for debugging only, used to verify the name of the optimization currently selected
    ‘ici je voudrais mettre un code du genre : “optim1.run”
    optim1.run
    Next

    End Sub

    http://catiav5.forumactif.org/t1167-lancer-optimisation-a-partir-d-une-macro

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

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