Assembly PatternFunctionPackage Functions

This package deals with functions used to create assembly patterns.

This page discusses:

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:

  • A part design pattern (rectangular or circular, or user pattern)
  • Or a geometric set containing set of axis systems

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 !!")
}

CreateASMPatternUsingComponentReference

This method creates pattern using component as a reference.

Signature

CreateASMPatternUsingComponentReference(iCompReference : VPMReference, isSpecification : String, isSpecificationContext : String, iPatternOption : CATAsmPatternOptions, oAsmPattern : CATAsmPatternConnection)) : Integer

Arguments

Name Input/Output Required? Type Comments
iCompReference In VPMReference Component as a reference
isSpecification In String

Full path of the specification feature, in string format.

It may be:

  • A part design pattern (rectangular or circular, or user pattern)
  • Or a geometric set containing set of axis systems

isSpecificationContext In String Common parent of Specification and Component
iPatternOption In CATAsmPatternOptions Object to represent pattern creation options
oAsmPattern Out CATAsmPatternConnection Object representing the newly created pattern

ReturnType

Integer

Example

Let Component (VPMReference)
Let TargetProduct(VPMReference)
Let Specification (String)
Let specContext (String)
Let CommonParent(VPMReference)
Let patternOption (CATAsmPatternOptions)
Let asmPattern (CATAsmPatternConnection)
Let rc (Integer)

set Component = CompReference (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 reference
      rc=CreateASMPatternUsingComponentReference (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 !!")
}

CreateAssemblyPatternOption

This method creates a pattern option object.

Signature

CreateAssemblyPatternOption(oAsmPatternOption : CATAsmPatternOptions) : Integer

Arguments

Name Input/Output Required? Type Comments
oAsmPatternOption Out CATAsmPatternOptions Pattern option object will be returned.

ReturnType

Integer

DeleteAssemblyPattern

This method deletes patterns.

Signature

DeleteAssemblyPattern(iParentProductReference : VPMReference, iAsmPattern : CATAsmPatternOptions, ibDeleteInstance : Boolean) : Integer

Arguments

Name Input/Output Required? Type Comments
iAsmPattern In CATAsmPatternOptions

The object representing the newly created pattern to be deleted

ibDeleteInstance In Boolean

Boolean whether to Delete pattern instances

ReturnType

Integer

Example

 Integer rc  = DeleteAssemblyPattern (CATAsmPatternConnection, bool)

GetAssemblyPatternInstances

This method will get list of created instances. This is available on CATAsmPatternConnection.

Signature

CATAsmPatternConnection.GetAssemblyPatternInstances(oListOfPatternInstances : List) : Integer

Arguments

Name Input/Output Required? Type
oListOfPatternInstances Out List

ReturnType

Integer

Example

Let InstancesList (List)

          Integer  rc = CATAsmPatternConnection.GetAssemblyPatternInstances(InstancesList)

GetAssemblyPatternSpecification

This method will return the full path of specification feature in string format. This is available on CATAsmPatternConnection.

Signature

CATAsmPatternConnection.GetAssemblyPatternSpecification(oAssemblyPatternSpecification : String) : Integer

Arguments

Name Input/Output Required? Type
oAssemblyPatternSpecification Out String

ReturnType

Integer

Example

Let SpecificationName (string)

 Integer rc  = CATAsmPatternConnection.GetAssemblyPatternSpecification(SpecificationName)