vcProductType

Product type is a product definition that is used to create vcProduct instances.

See in: Overview

Module: vcProcessModel

Parent: vcObject

Children: vcAssemblyProductType

Referenced by: vcChangeProductTypeStatement.NewType, vcCreateProductStatement.ProductType, vcDistributionModeProductLineEntry.ProductType, vcProcessFlowGroup.ProductTypes, ... (see more)
vcChangeProductTypeStatement.NewType
vcCreateProductStatement.ProductType
vcDistributionModeProductLineEntry.ProductType
vcProcessFlowGroup.ProductTypes
vcProduct.ProductType
vcProductCreatorFeedBatch.Part
vcProductCreatorSingleMode.Part
vcProductCreatorTableRow.ProductType
vcProductTypeAssemblyPatternItem.DefaultProductType
vcProductTypeFilter.AcceptedProductTypes
vcProductTypeManager.ProductTypes
vcProductTypeManager.createProductTypeTo()
vcProductTypeManager.findProductType()

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
ComponentPropertiesvcPropertyContainerRGets the properties that are applied to components of product instances created from this product type.
ComponentUriStringRWGets a component used to visualize product instances created from this product type.
FlowGroupvcProcessFlowGroupRGets the flow group this product type belongs to.
IsAssemblyBooleanRGets a value which defines if this product type is an assembly product type.
IsSystemBooleanRGets a value which defines if this product type is a built-in type.
NameStringRWGets or sets product type name.

Exceptions:
ValueError: When given name is empty or not unique.
ParentProductvcProductTypeRWGets or sets the parent product type of this product type.

Exceptions:
AttributeError: When the new parent is not viable.
ProductPropertiesvcPropertyContainerRGets the properties that are applied to product instances created from this product type.
PropertiesvcPropertyContainerRGets the properties of this product type itself.
UniqueIdStringRGets the unique identifier for this product type.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
createProductvcProductOptional Keyword[container = vcContainer]Creates and returns a new product instance of this product type.
See more
Parameters:
container(vcContainer): If given, the product component will be added to it.
Otherwise the product is added to the world container.

Exceptions:
RuntimeError: When attempting to create a circular nested assembly.
AttributeError: When given arguments are not valid.
deleteNoneNoneDeletes this product type.

Exceptions:
RuntimeError: When the type is a System type.
resetUniqueIdNoneNoneAssigns a new unique id for this product type.

Example: Create Product

"""Creates a product to the simulatino world based on the selected product type. """

import vcCore as vc
import vcProcessModel as vc_pm

uri = "file:///C:/Users/ ... / ... /My Models/Bottle.vcmx"
world = vc.getWorld()
flow_manager = world.ProcessController.FlowGroupManager
product_manager = world.ProcessController.ProductTypeManager

my_flow_group = flow_manager.findGroup("MyGroup")
if not my_flow_group:
  my_flow_group = flow_manager.createGroup("MyGroup")

my_product_type = product_manager.findProductType("BottleType")
if not my_product_type:
  my_product_type = product_manager.createProductTypeTo(my_flow_group, "BottleType")
  my_product_type.ComponentUri = uri

async def OnRun():
  my_product_instance = my_product_type.createProduct()
  print(my_product_instance)