Creating property via macro

Hello!

When creating the visualization cube, the " Total Length of the visualization cube", " Width..."  and " Thickness..."  " are created.

My goal is to retrieve the values of these properties and use them to populate my " Footprint " property in the form LengthxWidthxThickness.

For new parts, I will add the " Footprint " property in my models.

The value of this property will be:
$PRP:"Total Length of the Viewing Cube"x$PRP:"Total Width of the Visualization Cube"x$PRP:" Total Thickness of the Visualization Cube"

So, when you create a visualization cube, the assessed value of the property will become something like 150x100x10.

My problem is for a part created with an old model: I would like to have a macro that creates the " Clutter " property with the value above, if this property does not already exist.

Could someone help me with the creation of this macro? Or does anyone have an easier solution to achieve the same result?

Thanks in advance!

Hello

Watch this example from the API Help: Get Custom Properties for Configuration Example (VBA) - 2023 - SOLIDWORKS API Help
And mainly the code associated with cusPropMgr.Add3

3 Likes

Thank you!

I was able to create my macro from that!

2 Likes