2 Apr 2024

Extract physical information using Design Automation

If the Model Derivative API does not extract the information you need from the file type you are working with, you might be able to use one of the Design Automation engines instead.

In this case you have to be familiar with the API of the specific engine - e.g. in the case of Inventor I can do the following in order to get physical information out of the file types it supports (e.g. CATPart) based on this utility: https://aps.autodesk.com/blog/quick-tests-using-ilogic  

I can just use this iLogic code to print the info into the work item report - you could also save it into e.g. a json file that could be one of the outputs of the work item:

Dim strFileName = ThisDoc.Path + "\CATIA.CATPart"

Logger.Info("CATIA part to import: " + strFileName)

Dim catiaDoc As Inventor.PartDocument = ThisServer.Documents.Open(strFileName, True)

Dim volume = catiaDoc.ComponentDefinition.MassProperties.Volume
Logger.Info("Volume = " + volume.ToString())
Dim cog = catiaDoc.ComponentDefinition.MassProperties.CenterOfMass
Logger.Info("Center of Gravity = " + cog.X.ToString() + ", " + cog.Y.ToString()+ ", " + cog.Z.ToString())

Logger.Info("Done")

See picture on top showing the result.

 

 

   

Related Article