Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Tip - Export nodal information from WB into Excel

Status
Not open for further replies.

richg1

Mechanical
Sep 25, 2002
77
0
0
AU
I'm in the mood to share some info, so here goes...

If, like me you're not keen on using Ansys Classic, here is a script to export/capture node information from a surface in Workbench...

Overall process is to: a) Create a named selection set (eg Face) of the surface of interest b) ensure it is sufficiently meshed (i used a regular grid) c) create a command object in the Solution section with the following script...


! This code exports the nodal information for the mirror faces

/POST1
SET,FIRST

CMSEL,S,Face

*GET, NCOUNT, NODE, 0, COUNT
*SET, NNEXT, 0
*SET, LOOP, 0

*DIM, RESULTS_Face, ARRAY, NCOUNT, 11

*DO, LOOP, 1, NCOUNT, 1

*GET, NNEXT, NODE, NNEXT, NXTH
*GET, RESULTS_Face(LOOP,1), NODE, NNEXT, LOC, X
*GET, RESULTS_Face(LOOP,2), NODE, NNEXT, LOC, Y
*GET, RESULTS_Face(LOOP,3), NODE, NNEXT, LOC, Z
*GET, RESULTS_Face(LOOP,4), NODE, NNEXT, U, X
*GET, RESULTS_Face(LOOP,5), NODE, NNEXT, U, Y
*GET, RESULTS_Face(LOOP,6), NODE, NNEXT, U, Z
*GET, RESULTS_Face(LOOP,7), NODE, NNEXT, U, SUM
*GET, RESULTS_Face(LOOP,8), NODE, NNEXT, ROT, X
*GET, RESULTS_Face(LOOP,9), NODE, NNEXT, ROT, Y
*GET, RESULTS_Face(LOOP,10), NODE, NNEXT, ROT, Z
*GET, RESULTS_Face(LOOP,11), NODE, NNEXT, ROT, SUM

*ENDDO,

*CFOPEN,C:\Temp\RESULTS_Face,xls,,
*VWRITE,
('X Y Z UX UY UZ USUM ROTX ROTY ROTZ ROTSUM')
*VWRITE,RESULTS_Face(1,1), RESULTS_Face(1,2), RESULTS_Face(1,3), RESULTS_Face(1,4), RESULTS_Face(1,5), RESULTS_Face(1,6), RESULTS_Face(1,7), RESULTS_Face(1,8), RESULTS_Face(1,9), RESULTS_Face(1,10), RESULTS_Face(1,11)
(F17.9,' ',F17.9,' ',F17.9,' ',F17.9,' ',F17.9,' ',F17.9,' ',F17.9,' ',F17.9,' ',F17.9,' ',F17.9,' ',F17.9)
*CFCLOS



For those familiar with classic I imagine this is fairly simple. I also use a modified version of this to create some statistical information from the nodal information for processing in DesEx...Here's the script...


! This code exports the nodal information for the mirror faces

/POST1
SET,FIRST

my_RotSumMax = 0
my_RotSumMin = 0
my_RotSumMean = 0
my_RotSumStdv = 0

CMSEL,S,Face

*GET, NCOUNT, NODE, 0, COUNT
*SET, NNEXT, 0
*SET, LOOP, 0

*DIM, RESULTS_Face, ARRAY, NCOUNT, 11

*DO, LOOP, 1, NCOUNT, 1

*GET, NNEXT, NODE, NNEXT, NXTH
*GET, RESULTS_Face(LOOP,1), NODE, NNEXT, LOC, X
*GET, RESULTS_Face(LOOP,2), NODE, NNEXT, LOC, Y
*GET, RESULTS_Face(LOOP,3), NODE, NNEXT, LOC, Z
*GET, RESULTS_Face(LOOP,4), NODE, NNEXT, U, X
*GET, RESULTS_Face(LOOP,5), NODE, NNEXT, U, Y
*GET, RESULTS_Face(LOOP,6), NODE, NNEXT, U, Z
*GET, RESULTS_Face(LOOP,7), NODE, NNEXT, U, SUM
*GET, RESULTS_Face(LOOP,8), NODE, NNEXT, ROT, X
*GET, RESULTS_Face(LOOP,9), NODE, NNEXT, ROT, Y
*GET, RESULTS_Face(LOOP,10), NODE, NNEXT, ROT, Z
*GET, RESULTS_Face(LOOP,11), NODE, NNEXT, ROT, SUM

*ENDDO,

*VSCFUN,my_RotSumMax,MAX,RESULTS_Face(1,11)
*VSCFUN,my_RotSumMin,MIN,RESULTS_Face(1,11)
*VSCFUN,my_RotSumMean,MEAN,RESULTS_Face(1,11)
*VSCFUN,my_RotSumStdv,STDV,RESULTS_Face(1,11)


Enjoy ;)

Rich
 
Status
Not open for further replies.
Back
Top