Project - 2 - Generating the report for hypermesh file
Objective:
This project objective is to create script that will export data about model in easy to check and read format I decided to make it via .xml format that allows for tabular data presentation. Report is meant to be opened via exel and all informations about model will be presented in cells with description. Report should contain information about user who created it, date, time and profile deck info. Next part contains information about number of fea entites, eventually model will be checked against empty or unused and element quality criteria.
Problem Statement:
Having tool that can export information about model to easy to read file is usefull when exchanging models between workers. This report file can be send via email without need of attaching whole .hm model, and will give rough estimation what stage this model is at and how much work is to be done. On the other hand when working with model that somebody worked on before it is important to evaluate its condition. Those two scenarios can be facilitated via simple tcl script creating report about given model.
Tcl command explanation:
Script report.tcl can be divied to two parts, first establishes all variables needed for creating report and filling them with values. All information are also printed to console to give instant insight into report info. Second part starts with template for .xml file format, that is succesively printed to report file.
INFO section has user specific information containing, user name via $env(USERNAME) comman, time is captured by clock seconds command and then formated to date via clock format with specific option %D, when changed to %T results in time. Current profile deck is invoked with hm_info templatetype as in previous challenges.
Next section counts FEA entites simply getting marklength for all entities in model.
Last section WARNINGS has information about found duplicates, empty or unused and element quality check. Duplicates are checked in three steps for 1D, 2D and 3D elements via *elementtestduplicates elements 1 2 $i where i variable stands for 1D, 2D or 3D elements. If no present in model theri number will be turned to "NONE". Empty and unused are retrived by hm_getunusedoremptyentities changing mode to empty or unused. Eventually proc CheckElements taken from my previous scripts performs check on all elements, according to criteria specified in criteria_list variable.
Writing xml file starts with creating report file name and nesting file name there: Report_existing_name.xml . First line contains xml and encoding information. Main body is <Report>, than comes INFO substitiuting data in correct places. Same goes for FEA and DUPLICATE. Number of rows in those parts is determined and wont change. Next part that has WARRNINGS is expendable accoriding to number of found empty or unused, and number of element criterias that failed. If no warnings are found in model a message about that will appear.
Conclusion:
Report script was prepared to give clear and fast information about model condition. Via .xml format it can be imported and automatically formated basing on xml format options (no need to upload xml shema). Script was also tested on blank file. This kind of report contains all information needed to have rough insight into what certain model contains.
created by Adam