Hello,
I've been asked how one could preserve the hierarchy information of an FMEA during an export (via the "Generate table report" button at the top right).
A simple method is to display the hierarchy information as a number string (divided by a point for each level deeper) with a derived property. This can then just read or even further used by VBA scripts on Excel level.

The following script does the job, if used in a derived profile property named "user_hierarchy" for the "Component/Function (derived FMEA and SWA only)" profile:
/*
* Copyright (c) 2021 ANSYS Germany GmbH
* All rights reserved.
*
* THE NON STANDARD SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
* SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE NON STANDARD SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE NON STANDARD SOFTWARE.
*
* Show hierarchy information for FMEA entries - e.g. for first column, which is then also exported via "Generate table
* report". Self is expected to be an instance of Metamodel.FMEA.ComponentEntry.
*
* Note: This profile property has to be named "user_hierarchy" (otherwise you have to adjust the script)!
*
* v2022-01-26 - NH Initial version
*/
var prefix;
var myIndex;
var value;
if (self.parent) {
// lower level element in FMEA - find out position in parent's children list. Get prefix from parent
prefix = self.parent.user_hierarchy;
myIndex = self.parent.children.indexOf(self) + 1;
value = prefix + "." + myIndex;
} else {
// top level element in FMEA - find out position in topLevelComponents list
myIndex = self.worksheet.topLevelComponents.indexOf(self) + 1;
value = myIndex;
}
value;
Only drawback is that the profile property is correctly calculated for packages themselves, but not displayed in an FMEA. So the "headings" don't have that information printed.
I hope that can help someone.
Happy scripting,
Nils