Blog posts

Bio

By Clint Brown

If you are new to iLogic and want to start getting into how it works, give this a try as your first bit of code.

We are going to try create a rule that will create a message box showing the mass of the part or Assembly file we are in. To do this, follow this workflow:

Show your iLogic Browser (Manage Tab, iLogic Browser)

Create a new rule, this can be done by right clicking on the part/assembly at the top of the iLogic Browser, or click on "Add Rule" on the Manage tab

Copy and paste the code below into the new rule window, click OK

 

'Start of iLogic code
MessageBox.Show(iProperties.Mass, "Mass of Model in Kilograms")
'End of iLogic Code




Try this with Volume and Area too (see some code below)

MessageBox.Show(iProperties.Volume, "Volume of Model centimetere Cubed")
MessageBox.Show(iProperties.Area, "Area in centimeters squared")

Enjoy!