Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
phani.gampala
363 Views, 6 Replies

Placing and constraining multiple instances of fastners

Hello everyone,

I'm trying to place fasteners as sets, example: M10 x 25 SET SCREW, M10 FLAT WASHER AND M10 SPRING WASHER into my assembly so that I can constrain them to my assembly quicker. However when I place these components from content center and constrain them using ilogic it only works the first time. When a second instance of the fastener is placed  (for example:  SS Flat Washers 10 mm:2), how do I update the mate constraint that is supposed to constrain the fastener set. I have only pasted the problematic portion of the code. I need the code to place new instances every single time it is run and constrain them in the same way.

 

Component1 = Components.AddContentCenterPart("SS Flat Washers 10 mm:1","Fasteners:Washers:Plain","SS Flat Washers",
                                                 {"STOCK_TYPE","S","NND","10"},
                                                 position := Nothing, grounded := False, 
                                                 visible := True, appearance := Nothing)
Component2 = Components.AddContentCenterPart("SS Spring Washers 10 mm:1","Fasteners:Washers:Spring","SS Spring Washers",
                                                 {"STOCK_TYPE","S","NND","10"},
                                                 position := Nothing, grounded := False, 
                                                 visible := True, appearance := Nothing)

Constraints.AddMate("", "SS Flat Washers 10 mm:1", "Work Axis1", "SS Spring Washers 10 mm:1", "Work Axis1",
                    offset := 0.0, e1InferredType := InferredTypeEnum.kNoInference, e2InferredType := InferredTypeEnum.kNoInference,
                    solutionType := MateConstraintSolutionTypeEnum.kNoSolutionType,
                    biasPoint1 := Nothing, biasPoint2 := Nothing)
Constraints.AddMate("", "SS Flat Washers 10 mm:1", "YZ PLANE", "SS Spring Washers 10 mm:1", "YZ PLANE",
                    offset := 0.0, e1InferredType := InferredTypeEnum.kNoInference, e2InferredType := InferredTypeEnum.kNoInference,
                    solutionType := MateConstraintSolutionTypeEnum.kNoSolutionType,
                    biasPoint1 := Nothing, biasPoint2 := Nothing)