How to Create VirtualHardVertex

Akane Ito
Akane Ito Member Posts: 26
10 Comments Name Dropper
**

The following method can create a point, but I want to specify the surface for point creation using the surface ID instead of the SelectionManager.

  ds = ExtAPI.DataModel.InternalObject['ds']
sm = ds.SelectionManager
branch = ds.Tree.FirstActiveBranch
vcell_group = branch.VirtualCellGroup
vcell_group.CreateVirtualHardVertex(sm)

Answers

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 290
    100 Comments 25 Answers 25 Likes Photogenic
    ✭✭✭✭
    edited June 20
    faceID = 27
    point = Point([500,500,5000],'mm')
    
    selection=ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
    selection.Ids = [faceID]
    
    try: virtual_topology = ExtAPI.DataModel.Project.Model.AddVirtualTopology()
    except: virtual_topology = ExtAPI.DataModel.GetObjectsByType(Ansys.ACT.Automation.Mechanical.VirtualTopology)[0]
    
    virtual_topology.AddVirtualHardVertex(selection,point)
    
  • Akane Ito
    Akane Ito Member Posts: 26
    10 Comments Name Dropper
    **

    @Landon Mitchell Kanner
    Thank you! That was very helpful!