04-01-2024
08:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-01-2024
08:57 AM
Here's code to remove the decimal places from the mass. It will also add a 'g' (meaning grams).
{{{(topComponent['Mass'].toFixed() + ' g') || "" }}}
The following will convert the Design Status to text:
{{{(topComponent['Design Status'] == 2 ? 'Pending' : (topComponent['Design Status'] == 3 ? 'Released' : 'Work In Progress'))}}}
The following can be used to remove the time from a date property. It does it by removing the blank (specified by \s) between the date and time, and everything after the blank.
{{{ topComponent['Date Checked'].replace(/\s.*/g, '') }}}

Mike Deck
Software Developer
Autodesk, Inc.