How to Create VirtualHardVertex

Akane Ito
Akane Ito Member Posts: 38
10 Comments 5 Likes 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, GitHub-issue-creator Posts: 327
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited June 2024
    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: 38
    10 Comments 5 Likes Name Dropper
    **

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