Without having access to the package AceGen, the problem seems to come from a misusage of FilePrint: You SMSInitialize an object matrig or may be matrig.f. Then you call FilePrint with matrig.f as argument, which means that in den NotebookDirectory[] some file matrig.f has to be found and printed to the Out. But matrig.f is not a file, but an object. Check whether something is a file with FileExistsQ. Think whether you should use first Export to export the object matrig.f into a file ...