From the API reference it is not clear how to use function AssemblyPatterns.Create( PatternName, MasterOccurrences, FeaturePattern, ReferenceFeature) and what arguments to pass.
I used the following sample in VB to create a new AssemblyPattern but it always failed.
Dim objOccArray(1 To 1) As Object
Set objOccArray(1) = objAssmDoc.Occurrences(2)
Dim Occ As SolidEdgeAssembly.Occurrence
Occ = objAssmDoc.Occurrences(1)
Dim objPart As SolidEdgePart.PartDocument
objPart = Occ.OccurrenceDocument
objPattern = objPart.Models(1).Patterns.Item(1)
HoleObj = objPart.Models(1).Holes(1)
objAsmPattern = objAssmDoc.AssemblyPatterns.Create("MyPattern", objOccArray, objPattern, HoleObj)
I also tried to get parameters from already existing AssemblyPattern and used them to create another AssemblyPattern. To get parameters I used function AssemblyPatterns.GetInputs( ... ). Then I deleted the old AssemblyPattern and tried to create a new one using the retrieved parameters. But AssemblyPatterns.Create(...) failed again.
Thanks |