Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing index (%i%) in *do loop in Workbech

Status
Not open for further replies.

student2022

Mechanical
Joined
Dec 16, 2022
Messages
1
Location
MY
I am stuck in coding/scripting in ANSYS Workbench. I am trying to print/insert the index of a *do loop. The Python command %i% works in ANSYS APDL but not in Workbench. Any alternative, please

*do,i,1,10,1
*get,stress(%i%),....
*enddo

I expect to get:

stress (1)
stress (2)
stress (3)
.
.
.
stress (10)
 
Hello there,
try this and let me know.

Code:
*del,stress,,nopr
*dim,stress,array,10
*do,i,1,10,1
[indent]*get,stress(%i%),node,i,loc,x[/indent]
*enddo

Best regards
Jiri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top