If you want to get a list of ProductTypes:
…
product_type_list = product_type_manager.ProductTypes
…
and their names
for i in product_type_list:
print i.Name
Hi, Thank you for your reply. I can already access the vcProductType objects. And i can already print the list of the product types in my simulation.
What i want to access is the vcProduct object it self, and with this i want to be able to print out all the Product instances that are present in the simulation 3D world at any instance of time.
But, uptill now, i did not find a way to access the vcProduct objects.
from vcScript import *
app = getApplication()
def on_render_event(sim):
comps = app.Components
for comp in comps:
if comp.Product:
prod = comp.Product
print ("Product of type {} leaving from {}. Current SimTime -> {}".format(prod.ProductType.Name, prod.LastEnteredNode.Component.Name, sim.SimTime))
app.OnRender = on_render_event