Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mydir="./"
- outforcefile1 = mydir .. "ForceResults_up.txt"
- outforcefile2 = mydir .. "ForceResults_side.txt"
- open(mydir .. "Forcetest.fem")
- mi_saveas(mydir .. "temp.fem") --make a temp file for the processing
- -- the step size
- increment = 1
- -- determines the total distance to move up
- distance = 50
- -- calculates the amount of steps
- steps = distance/increment
- -- this part empties an already exsting file.
- handle = openfile(outforcefile1,"w")
- write(handle, "")
- closefile(handle)
- handle = openfile(outforcefile2,"w")
- write(handle, "")
- closefile(handle)
- -- loop that handles up motion
- for n=0,steps do
- mi_clearselected()
- mi_selectgroup(1) --select the TT shape
- mi_movetranslate(0, increment) --move up
- mi_analyze(1)
- mi_loadsolution()
- mo_groupselectblock(1)
- forceY = mo_blockintegral(19)
- position = n
- handle = openfile(outforcefile1,"a")
- write(handle, position, "\t", forceY, "\n")
- closefile(handle)
- end
- -- loop that handles side motion
- for n=0,steps do
- mi_clearselected()
- mi_selectgroup(x) -- replace x by the needed group number
- mi_movetranslate(-increment, 0) --negative sign is left movement, no sign is right movement
- mi_analyze(1)
- mi_loadsolution()
- mo_groupselectblock(1)
- forceY = mo_blockintegral(19)
- position = n
- handle = openfile(outforcefile2,"a")
- write(handle, position, "\t", forceY, "\n")
- closefile(handle)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement