Product properties using python

I’m planning a project in Simumatik that I hopefully will get time to test soon.

For this I’m wondering if it would be possible to use python to create products?
Would it be possible to use python to set for example height, width, length and from this get a variable for mass/weight? This could be “momentarily” so that the products are not saved in the list of products but only exists while the product is in the workplace.

With this it would be easier to create a variety of products that differ just a bit and better reflect a real senario.

Best,

Martin

Hi Martin,
It is possible to create a product that automatically randomizes som properties when it is introduced to the workspace.

Below you can see an example:

The result when adding the component to a product entry is the next:
randomcomp

I hope it helps!

Hi! This was exactly what i was looking for, thank you!

best,

Martin

Hi!

I’ll have to go back to this question now that i’ve had time to test it.
For the variable size, should it be smtk_float?

when i try to drag the variable from the base - visual - geometry - box - size i can’t drop it on my output-size.

The color variable in rgba works fine and the color from the material list can be dropped to its output.

I have tried creating a variable visible (bool) and that works fine but neither collision or size want to be dropped on the size output.

Best,

Martin

Hi Martin,
You have to use the scale of the geometry for now. We are planing to add other variables in the future.
When we tested it, we created a unitary box and modify the scale so we could adjust the size of both the visual and the collision.