Mass format wrong in 3d PDF

Mass format wrong in 3d PDF

HLendorf
Participant Participant
399 Views
1 Reply
Message 1 of 2

Mass format wrong in 3d PDF

HLendorf
Participant
Participant

Hello All,

 

Trying to build a new 3d template (using Kofax Power PDF - similar capabilities as Adobe Acrobat Pro).

A "header" has been made in the 3d PDF template to include std. header information as for a 2d PDF. 

Now stuck on the formatting of Mass using the following "Javascript": 

 

 

 

{{{ topComponent['Mass'] || "" }}}

 

 


Mass is grabbed ok by template from Inventor - however the decimal point is off by a factor of 3 - eg. Inventor (from properties) shows 0.023 kg, but this becomes 22.839484660076849 in the 3d PDF.

 

- Any ideas how to fix decimal point?

 

Maybe there is also a way to "round" up - just as Inventor does natively in the iProperties - Physical value listed.

I looked also at the Anark Core Static PDF Template reference listed in other threads - but can't really find anything specific - maybe from using syntax listed 🤔

PS. Basically it's a question to format the command  {{{ topComponent['Mass'] || "" }}}, as I also this to grab both the 'Description' and 'Part Number' - etc.

 

Included a few screenshots to help explain 😉

0 Likes
Accepted solutions (1)
400 Views
1 Reply
Reply (1)
Message 2 of 2

HLendorf
Participant
Participant
Accepted solution

I will just answer this myself - as I managed to find solution.

 

The below script can be used to truncate and format the weight as needed in Inventor - as you can add value into a Custom iProperty. The downside is that you need to create a new ipt/iam template with this added custom iProperty - but works nicely 🙂

 

 

iProperties.Value("Custom", "massformat") = (Round(iProperties.Mass,3) & " kg")
InventorVb.DocumentUpdate()

 

 

I used the custom iProperty "massformat" - and this truncates the mass to 3 decimal points, and adds kg, so from above sample you now get correct 0,023 kg - in this case in the 3d PDF (generated by the Anark code and edited in Power PDF for updated template).

 

Hope this may also help others facing the same issue  😁