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