In this article, we will use Assembly Mates to assemble the valve attached.
Step 1 : Fix Valve Body and add Concentric Mate to Retainer with Concentric Mate
To begin, we fix the Valve Body in place and then add Concentric mates between the valve body and retainer faces to align them concentrically.
ReadSTEP rs = new ReadSTEP(@"C:\devDept\Assembly VALVE BODY.step");
rs.DoWork();
rs.OpenTo(design1);
BlockReference ValveBodyBR = (BlockReference)design1.Entities[5];
ValveBodyBR.IsFixed = true;
BlockReference RetainerBR = (BlockReference)design1.Entities[8];
Brep ValveBody = (Brep)ValveBodyBR.GetEntities(design1.Blocks)[0];
Brep Retainer = (Brep)RetainerBR.GetEntities(design1.Blocks)[0];
design1.RootBlock.AddConcentricMate(Retainer.Faces[3], new Stack<BlockReference>(new[] { RetainerBR }),
ValveBody.Faces[13], new Stack<BlockReference>(new[] { ValveBodyBR }), true);
design1.RootBlock.AddConcentricMate(Retainer.Faces[2], new Stack<BlockReference>(new[] { RetainerBR }),
ValveBody.Faces[48], new Stack<BlockReference>(new[] { ValveBodyBR }), false);
Step 2: Fix Retainer and add Concentric Mate to first couple of bolt and nut pair
Next, we attach the retainer to the valve body through Coincident mate. Then, add a Concentric mate between the retainer's faces and the faces of the first bolt and nut pair.
design1.RootBlock.AddCoincidentMate(Retainer.Faces[6], new Stack<BlockReference>(new[] { RetainerBR }),
ValveBody.Faces[5], new Stack<BlockReference>(new[] { ValveBodyBR }), false);
BlockReference HexHeadBR1 = (BlockReference)design1.Entities[0];
BlockReference ChamferedBR1 = (BlockReference)design1.Entities[1];
Brep HexHead1 = (Brep)HexHeadBR1.GetEntities(design1.Blocks)[0];
Brep Chamfered1 = (Brep)ChamferedBR1.GetEntities(design1.Blocks)[0];
design1.RootBlock.AddConcentricMate(Retainer.Faces[1], new Stack<BlockReference>(new[] { RetainerBR }),
HexHead1.Faces[7], new Stack<BlockReference>(new[] { HexHeadBR1 }), true);
design1.RootBlock.AddConcentricMate(Retainer.Faces[1], new Stack<BlockReference>(new[] { RetainerBR }),
Chamfered1.Faces[1], new Stack<BlockReference>(new[] { ChamferedBR1 }), false);
Step 3: Add Coincident Mate to first bolt and nut pair
Add Coincident mates between the chamfered face and the hex head of the first screw, and between the retainer's face and the chamfered face, so that the first screw is constrained to rotation only.
design1.RootBlock.AddCoincidentMate(Chamfered1.Faces[0], new Stack<BlockReference>(new[] { ChamferedBR1 }),
HexHead1.Faces[6], new Stack<BlockReference>(new[] { HexHeadBR1 }), true);
design1.RootBlock.AddCoincidentMate(Retainer.Faces[5], new Stack<BlockReference>(new[] { RetainerBR }),
Chamfered1.Faces[2], new Stack<BlockReference>(new[] { ChamferedBR1 }), true);
Step 4: Repeat the process for the other two bolt and nut pair
Initially, add a Concentric mate between the retainer’s face and the faces of the bolt and nut pair.
Then, add Coincident mates between the chamfered face and the hex head of the other two screws, as well as between the retainer’s face and the chamfered face of each screw, so that the screws are constrained to rotate only.
BlockReference HexHeadBR2 = (BlockReference)design1.Entities[3];
BlockReference ChamferedBR2 = (BlockReference)design1.Entities[4];
Brep HexHead2 = (Brep)HexHeadBR2.GetEntities(design1.Blocks)[0];
Brep Chamfered2 = (Brep)ChamferedBR2.GetEntities(design1.Blocks)[0];
BlockReference HexHeadBR3 = (BlockReference)design1.Entities[14];
BlockReference ChamferedBR3 = (BlockReference)design1.Entities[6];
Brep HexHead3 = (Brep)HexHeadBR3.GetEntities(design1.Blocks)[0];
Brep Chamfered3 = (Brep)ChamferedBR3.GetEntities(design1.Blocks)[0];
design1.RootBlock.AddConcentricMate(Retainer.Faces[2], new Stack<BlockReference>(new[] { RetainerBR }),
HexHead2.Faces[7], new Stack<BlockReference>(new[] { HexHeadBR2 }), true);
design1.RootBlock.AddConcentricMate(Retainer.Faces[2], new Stack<BlockReference>(new[] { RetainerBR }),
Chamfered2.Faces[1], new Stack<BlockReference>(new[] { ChamferedBR2 }), false);
design1.RootBlock.AddCoincidentMate(Chamfered2.Faces[0], new Stack<BlockReference>(new[] { ChamferedBR2 }),
HexHead2.Faces[6], new Stack<BlockReference>(new[] { HexHeadBR2 }), true);
design1.RootBlock.AddCoincidentMate(Retainer.Faces[5], new Stack<BlockReference>(new[] { RetainerBR }),
Chamfered2.Faces[2], new Stack<BlockReference>(new[] { ChamferedBR2 }), true);
design1.RootBlock.AddConcentricMate(Retainer.Faces[0], new Stack<BlockReference>(new[] { RetainerBR }),
HexHead3.Faces[7], new Stack<BlockReference>(new[] { HexHeadBR3 }), true);
design1.RootBlock.AddConcentricMate(Retainer.Faces[0], new Stack<BlockReference>(new[] { RetainerBR }),
Chamfered3.Faces[1], new Stack<BlockReference>(new[] { ChamferedBR3 }), false);
design1.RootBlock.AddCoincidentMate(Chamfered3.Faces[0], new Stack<BlockReference>(new[] { ChamferedBR3 }),
HexHead3.Faces[6], new Stack<BlockReference>(new[] { HexHeadBR3 }), true);
design1.RootBlock.AddCoincidentMate(Retainer.Faces[5], new Stack<BlockReference>(new[] { RetainerBR }),
Chamfered3.Faces[2], new Stack<BlockReference>(new[] { ChamferedBR3 }), true);
Step 5: Add Concentric Mate for the first Pan Head Screw on Plate
Add Concentric mates between the plate and the first pan head screw.
BlockReference PlateBR = (BlockReference)design1.Entities[2];
Brep Plate = (Brep)PlateBR.GetEntities(design1.Blocks)[0];
BlockReference PanHeadBR1 = (BlockReference)design1.Entities[10];
Brep PanHead1 = (Brep)PanHeadBR1.GetEntities(design1.Blocks)[0];
design1.RootBlock.AddConcentricMate(Plate.Faces[0], new Stack<BlockReference>(new[] { PlateBR }),
PanHead1.Faces[7], new Stack<BlockReference>(new[] { PanHeadBR1 }), true);
Step 6: Fix the First Pan Head Screw to Plate
Add a Coincident mate between the plate and the first pan head screw to fix it in position.
design1.RootBlock.AddCoincidentMate(Plate.Faces[5], new Stack<BlockReference>(new[] { PlateBR }),
PanHead1.Faces[5], new Stack<BlockReference>(new[] { PanHeadBR1 }), true);
Step 7: Repeat for the Second and Third Pan Head Screws
Add Concentric and Coincident mates for the second and third pan head screws on the plate, as explained in Step 5 and Step 6.
BlockReference PanHeadBR2 = (BlockReference)design1.Entities[9];
Brep PanHead2 = (Brep)PanHeadBR2.GetEntities(design1.Blocks)[0];
BlockReference PanHeadBR3 = (BlockReference)design1.Entities[13];
Brep PanHead3 = (Brep)PanHeadBR3.GetEntities(design1.Blocks)[0];
design1.RootBlock.AddConcentricMate(Plate.Faces[1], new Stack<BlockReference>(new[] { PlateBR }),
PanHead2.Faces[7], new Stack<BlockReference>(new[] { PanHeadBR2 }), false);
design1.RootBlock.AddCoincidentMate(Plate.Faces[5], new Stack<BlockReference>(new[] { PlateBR }),
PanHead2.Faces[5], new Stack<BlockReference>(new[] { PanHeadBR2 }), true);
design1.RootBlock.AddConcentricMate(Plate.Faces[2], new Stack<BlockReference>(new[] { PlateBR }),
PanHead3.Faces[7], new Stack<BlockReference>(new[] { PanHeadBR3 }), false);
design1.RootBlock.AddCoincidentMate(Plate.Faces[5], new Stack<BlockReference>(new[] { PlateBR }),
PanHead3.Faces[5], new Stack<BlockReference>(new[] { PanHeadBR3 }), true);
Step 8: Add Concentric Mate between Retainer and Stem
Add a Concentric mate between the retainer and the stem, aligning their respective faces.
BlockReference StemBR = (BlockReference)design1.Entities[12];
Brep Stem = (Brep)StemBR.GetEntities(design1.Blocks)[0];
design1.RootBlock.AddConcentricMate(Retainer.Faces[3], new Stack<BlockReference>(new[] { RetainerBR }),
Stem.Faces[0], new Stack<BlockReference>(new[] { StemBR }), true);
Step 9: Fix Stem with Plate Screw and Concentric Mate
Add Concentric mates to fix the stem with the plate using pan head screws associated faces.
design1.RootBlock.AddConcentricMate(PanHead1.Faces[7], new Stack<BlockReference>(new[] { PanHeadBR1 }),
Stem.Faces[12], new Stack<BlockReference>(new[] { StemBR }), false);
design1.RootBlock.AddCoincidentMate(Plate.Faces[4], new Stack<BlockReference>(new[] { PlateBR }),
Stem.Faces[9], new Stack<BlockReference>(new[] { StemBR }), true);
design1.RootBlock.AddConcentricMate(PanHead3.Faces[7], new Stack<BlockReference>(new[] { PanHeadBR3 }),
Stem.Faces[10], new Stack<BlockReference>(new[] { StemBR }), false);
Step 10: Fix Stem and Valve Body
Add a Coincident mate between the valve body and stem, fixing them together.
design1.RootBlock.AddCoincidentMate(ValveBody.Faces[15], new Stack<BlockReference>(new[] { ValveBodyBR }),
Stem.Faces[6], new Stack<BlockReference>(new[] { StemBR }), false);
Step 11: Concentric Mate for Arm and First Screw
Add a Concentric mate between the arm and stem, and also between the arm and parallel pin using their respective faces.
BlockReference ArmBR = (BlockReference)design1.Entities[7];
Brep Arm = (Brep)ArmBR.GetEntities(design1.Blocks)[0];
BlockReference ParallelPinBR = (BlockReference)design1.Entities[11];
Brep ParallelPin = (Brep)ParallelPinBR.GetEntities(design1.Blocks)[0];
design1.RootBlock.AddConcentricMate(Stem.Faces[5], new Stack<BlockReference>(new[] { StemBR }),
Arm.Faces[3], new Stack<BlockReference>(new[] { ArmBR }), false);
design1.RootBlock.AddConcentricMate(Arm.Faces[9], new Stack<BlockReference>(new[] { ArmBR }),
ParallelPin.Faces[2], new Stack<BlockReference>(new[] { ParallelPinBR }), false);
Step 12: Fix Arm with Stem and Parallel Pin
Add Concentric mates to fix the arm with the stem and parallel pin. In the end, add a Tangent mate between the arm's face and the parallel pin's face.
design1.RootBlock.AddConcentricMate(Stem.Faces[13], new Stack<BlockReference>(new[] { StemBR }),
ParallelPin.Faces[2], new Stack<BlockReference>(new[] { ParallelPinBR }), false);
design1.RootBlock.AddTangentMate(Arm.Faces[2], new Stack<BlockReference>(new[] { ArmBR }),
ParallelPin.Faces[0], new Stack<BlockReference>(new[] { ParallelPinBR }), true);
Comments
Please sign in to leave a comment.