Cancel
Showing results for 
Search instead for 
Did you mean: 

How to used feature pattern in an Assembly

Pioneer
Pioneer

Hi everyone,I am trying to create pattern feature in assembley environment.I also read some previous thread but still problem is occur.Can anyone guide me how to paased argument for pattern method in below attched code:

Thanks.

SolidEdgeFramework.Application appl = null;
      SolidEdgeFramework.Documents docs = null;
      SolidEdgeAssembly.AssemblyDocument aDoc = null;
      SolidEdgeAssembly.Occurrences occurences = null;
      object featref = null;
      object faceref = null;
            
      string shellBodyName = @"D:\DCH\ShellBody.par";
      string LiftingLugSubAssemblyyName = @"D:\DCH\Lifting Lug SubAssembly.asm";

      try
         {
                SolidEdgeCommunity.OleMessageFilter.Register();

                appl = SolidEdgeCommunity.SolidEdgeUtils.Connect(true, true);
                docs = appl.Documents;
                aDoc = (SolidEdgeAssembly.AssemblyDocument)docs.Add("SolidEdge.AssemblyDocument", Missing.Value);
                occurences = aDoc.Occurrences;
                
                Occurrence ShellBodyOcc = occurences.AddByFilename(shellBodyName);
                Occurrence LiftingLugSubAssemblyOcc = occurences.AddWithTransform(LiftingLugSubAssemblyyName, 0.812, 0, 3.5, 0, 0, 0);

                Occurrence[] patternPart = new Occurrence[1];
                patternPart[0] = LiftingLugSubAssemblyOcc;

                featref = aDoc.CreateReference(ShellBodyOcc,)

                AssemblyPattern asp = aDoc.AssemblyPatterns.Create(PatternName: "Lift Lug ",
                    MasterOccurrences: patternPart.ToArray(), FeaturePattern: ,
                    ReferenceFeature: );

Apattern.PNG