How to export loads and supports nodes (Boundary Conditions) using ACT?

Hello everyone!

This is my first post as I am starting working with ANSYS at my university.

I started to learn ACT because I need to export some information from ANSYS to use in Matlab, first I exported the nodes and elements. But now I would like to obtain the nodes that corresponds to loads and supports, I know this should be possible because the input file generated contains the node IDs to solve the system of equations, but I can't find the correct commands to do it! Hope you can help me.

I share my functional code to export nodes and elements (Hope you find useful)


import os

# Mesh Data Export From ANSYS Model
def MeshDataFunc(file_name):
   
    MeshF=open(file_name,"w")
   
    #Number of nodes and elements
    meshD = DataModel.MeshDataByName("Global")
    nnodes=meshD.NodeCount
    nelem=meshD.ElementCount
    nodesID=range(1,meshD.NodeCount+1)
    elemsID=range(1,meshD.ElementCount+1)

    MeshF.write("|||||-----NUMBER OF NODES-----|||||
")
    MeshF.write(str(nnodes))
    MeshF.write("
")
    MeshF.write("|||||-----NUMBER OF ELEMENTS-----|||||
")
    MeshF.write(str(nelem))   
    MeshF.write("
")
   
    #Print Nodes
    print "MESH NODES"
    MeshF.write("|||||-----MESH NODES-----|||||
")
    MeshF.write("ID X Y Z
")
    for meshId in nodesID:
        node = meshD.NodeById(meshId)
        print "%s    %s    %s    %s" % (meshId, node.X, node.Y, node.Z)
        MeshF.write(str(meshId))
        MeshF.write(" ")
        MeshF.write(str(node.X))
        MeshF.write(" ")
        MeshF.write(str(node.Y))
        MeshF.write(" ")
        MeshF.write(str(node.Z))
        MeshF.write("
")
       
    #Print ELEMENTS
    print "MESH ELEMENT CONNECTIVITIES"
    MeshF.write("|||||-----MESH ELEMENT CONNECTIVITIES-----|||||
")
    MeshF.write("ID node1 node2 node3
")
    for meshId in elemsID:
        elem=meshD.NodeIdsFromElementIds([meshId])
        print "%s    %s    %s    %s" % (meshId, elem[0], elem[1], elem[2])
        MeshF.write(str(meshId))
        MeshF.write(" ")
        MeshF.write(str(elem[0]))
        MeshF.write(" ")
        MeshF.write(str(elem[1]))
        MeshF.write(" ")
        MeshF.write(str(elem[2]))
        MeshF.write("
")

"""////// Main //////"""

appDataPath_folder = os.getenv("USERPROFILE")
matpath=appDataPath_folder+("Documents")
file_name=matpath+str("MeshData.dat")

#Mesh Data Extraction Function

MeshDataFunc(file_name)
   

Sign In or Register to comment.