CreateASMPatternUsingComponentInstance
This method creates pattern using component as an instance.
Signature
CreateASMPatternUsingComponentInstance(iCompInstance : VPMInstance, isSpecification : String, isSpecificationContext : String, iPatternOption : CATAsmPatternOptions, oAsmPattern : CATAsmPatternConnection)
Arguments
| Name | Input/Output | Required? | Type | Comments |
|---|---|---|---|---|
iCompInstance |
In | | VPMInstance | Component as an instance |
isSpecification |
In | | String |
Full path of the specification feature, in string format. It may be:
|
isSpecificationContext |
In | | String |
Common parent of Specification and Component |
iPatternOption |
In | | CATAsmPatternOptions | Object to represent pattern creation options |
oAsmPattern |
Out | | CATAsmPatternConnection | The object representing the newly created pattern |
ReturnType
Integer
Example
Let Component (VPMInstance)
Let TargetProduct(VPMReference)
Let Specification (String)
Let specContext (String)
Let CommonParent(VPMReference)
Let patternOption (CATAsmPatternOptions)
Let asmPattern (CATAsmPatternConnection)
Let rc (Integer)
set Component = CompInstance (which is selected from UI)
set Specification = "Part4.1\3D Shape00000010_5689702B-0000-4074-677E54E90006247B ---.000\RectPattern.1"
set SpecContext = “ParentComp.1\CompSubAssy2.1”
// Creation of Pattern option object
CreateAssemblyPatternOption(patternOption)
If patternOption <> NULL
{
// Keep link as TRUE
// all arguments of ‘patternOption’ are compulsory
patternOption.KeepLink = true
patternOption.TargetProductRef = TargetProduct
patternOption.SpecificationContext= CommonParent
// Creation of Pattern using Component as Instance
rc=CreateASMPatternUsingComponentInstance (Component, Specification, specContext, patternOption, asmPattern)
if asmPattern <> NULL
{
// Usage of GetAssemblyPatternInstances
Let InstancesList (List)
rc = asmPattern.GetAssemblyPatternInstances(InstancesList)
// Usage of GetAssemblyPatternSpecification
Let SpecificationName (string)
rc =asmPattern.GetAssemblyPatternSpecification(SpecificationName)
Message("Pattern createdL !!", "InstanceSize:", InstancesList.Size(), " \n Spec Name: ", SpecificationName)
// Usage of DeleteAssemblyPattern
rc = DeleteAssemblyPattern(asmPattern, True)
}
else
{
Message ("Pattern creation failed !!")
}
}
else
{
Message ("patternOption object is NULL !!")
}