Trimech-Main-Site-Group-Navigation Trimech-Main-Site-Group-Navigation Trimech-Main-Site-Group-Navigation Solid-Solutions-Group-Navigation Javelin-Group-Navigation Solid-Print-Group-Navigation 3DPRINTUK-Group-Navigation Trimech-Enterprise-Solutions-Group-Navigation Trimech-Enterprise-Solutions-Group-Navigation Trimech-Advanced-Manufacturing-Group-Navigation Trimech-Staffing-Solutions-Group-Navigation
With over 35 years of experience, the TriMech Group offers a comprehensive range of design, engineering, staffing and manufacturing solutions backed by experience and expertise that is unrivalled in the industry. The TriMech Group's solutions are delivered by the divisions and brands shown here, use the links above to visit the group's websites and learn more.

Simulation Tips: How to Customise MSC Apex

Monday December 18, 2023 at 8:00am

MSC Apex is Hexagon’s next generation pre/post processor for FEA. It does an amazing job of geometry preparation and meshing and addresses some basic job set up for MSC Nastran.

Apex does not have the depth and breadth of feature support that, for example, Patran has. Apex is several decades younger than Patran in terms of development so to an extent this is to be expected, but the gap will close with each successive release with a focus on intuitive ease of use and process time savings.

This can be problematic for some clients who wish to migrate more quickly from their existing pre-processor, but there is a solution – customisation.

Apex uses Python as an API language. Python is becoming the de-facto standard scripting language among analysts and many commercial apps are now using it for API access.

There’s three ways you can use Python to automate and customise Apex:

  1. Through macros triggered manually
  2. Through scripts triggered automatically
  3. Through custom menus


It is a simple job to record a macro as Python script. Simply press ‘record’, give it a name, step through the actions in Apex then press stop. The macro is saved into your working folder.

You can then edit this to use standard Python routines such as loops so that when you play the macro back a repetitive task would be automated.

Automating repetitive tasks not only saves time but eliminates the ‘pilot error’ problems from a human doing something over and over again.


Manual macros are of benefit, but the benefit accrues if they can be triggered automatically by actions in the GUI or at certain stages of a model build.

MSC Apex provides a configuration tool to allow you to define which functions get triggered after what actions.

For example, as in the above image, you might have a standard set of materials that are used in your organisation. You could configure Apex to automatically create these materials in every new database as soon as it is created.

Another example, created for a client in the space industry, is a script that builds a standard set of model check runs when a Nastran deck is exported. It uses an IF check on the file name so that any deck written out with the string RUNCHECK included in the name triggers the script.

This is where it gets really powerful. Apex is shipped with a whole toolbar full of customised tools for attribution, fastener creation, geometry/FEM, querying, custom views and more.

These are created by field engineers within Hexagon in order to streamline processes and to back fill capability for specific clients ahead of it being introduced through the rigorous development process.

These tools have wide range of complexity. The simplest tools have capability such as producing a list of how many nodes and/or elements there are in each part in the model.

As an example of extending the complexity of the automated scripts, there is the ‘My Materials’ tool that allows you to selectively import materials from a pre-defined Excel sheet.

This would allow you to manage your materials database across all users from a shared document.

The most complex are probably those in the Fastener menu where one in particular is capable of scanning through all your selected geometry, identifying holes in surfaces and solids, checking for a matching hole on a neighbouring entity and automatically constructing a beam+RBE bolt representation with the diameter taken from the hole sizes.

This is a fantastic bit of coding that could save users huge amounts of time.

All of these tools are supplied with the source code which greatly simplifies the process of creating your own tools by extracting and combining snippets and then defining your own toolbar with your own tools included.

If you are interested in adding to the capability within MSC Apex or interested in taking a look at Apex with a view to changing FEA modellers, please get in touch to talk about your requirements.

Take the Next Steps...

If you’d like to learn more, please get in touch to find out how we can help you get the most out of your company’s simulation.

Fill in the Form Below to Contact Us

Related Blog Posts

3 Easy Ways to Make Your Renders More Realistic wi
Learn how to add realism quickly in SOLIDWORKS Visualize with these 3 top tips!
Calculating the Trajectory of a Cricket Ball with
Can SOLIDWORKS Motion help to improve your bowling accuracy?
The Best Way to Work Efficiently with Windows File
Discover how to use Enterprise Item Numbers and auto-naming to enhance your workflow.

 Solid Solutions | Trimech Group