August 8, 2024 at 2:38 pm
Erik Kostson
Ansys Employee
For linear load (selects a named selection called beam1).
CMSEL,S,beam1,ELEM
*GET,ECOUNT,ELEM,,COUNT Â Â Â Â Â Â Â ! Get total number of elements
Â
ELi=0
Â
*DO,i,1,ECOUNT,1
ELi=ELNEXT(ELi)
*GET, EI, ELEM, ELi, NODE, 1 ! Find first node
*GET, EJ, ELEM, ELi, NODE, 2 ! Find second node
*GET, XI, NODE, EI, LOC, X, ! Find x coordinates
*GET, XJ, NODE, EJ, LOC, X, ! Find x coordinates
SFBEAM,i,2,PRES,(XI),(XJ) ! Apply pressure
*ENDDO
ALLSEL,ALL,ALL