We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.

Ansys Learning Forum Forums Discuss Simulation General Mechanical Sinusoidal Load in Ansys APDL Reply To: Sinusoidal Load in Ansys APDL

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