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.
| Name | Type | Access | Description |
| ComponentProperties | vcPropertyContainer | R | Gets the properties that are applied to components of product instances created from this product type. |
| ComponentUri | String | RW | Gets a component used to visualize product instances created from this product type. |
| FlowGroup | vcProcessFlowGroup | R | Gets the flow group this product type belongs to. |
| IsAssembly | Boolean | R | Gets a value which defines if this product type is an assembly product type. |
| IsSystem | Boolean | R | Gets a value which defines if this product type is a built-in type. |
| Name | String | RW | Gets or sets product type name. Exceptions: ValueError: When given name is empty or not unique. |
| ParentProduct | vcProductType | RW | Gets or sets the parent product type of this product type. Exceptions: AttributeError: When the new parent is not viable. |
| ProductProperties | vcPropertyContainer | R | Gets the properties that are applied to product instances created from this product type. |
| Properties | vcPropertyContainer | R | Gets the properties of this product type itself. |
| UniqueId | String | R | Gets the unique identifier for this product type. |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| createProduct | vcProduct | Optional Keyword[container = vcContainer] | Creates and returns a new product instance of this product type.See moreParameters: 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. |
| delete | None | None | Deletes this product type. Exceptions: RuntimeError: When the type is a System type. |
| resetUniqueId | None | None | Assigns 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)