How to define a contact match using scripting

Erik Kostson
Erik Kostson Member, Moderator, Employee Posts: 312
50 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭
edited February 19 in Structures

How to define a mesh edit object, contact match group and subsequently a contact match using mechanical scripting?

Answers

  • Erik Kostson
    Erik Kostson Member, Moderator, Employee Posts: 312
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited February 19

    Below is an example:

    model = ExtAPI.DataModel.Project.Model
    meshedit = model.AddMeshEdit()
    conmatgrp = meshedit.AddContactMatchGroup()
    conmatc= conmatgrp .AddContactMatch()
    
    
    #select faces
    selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
    selection.Ids = [23] # change ids as needed
    conmatc.MasterLocation = selection
    selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
    selection.Ids = [49]
    conmatc.SlaveLocation=selection
    
This discussion has been closed.