07-27-2022
03:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
07-27-2022
03:38 PM
If you replace the static occurrence name with "" in AddContentCenterPart this will then automatically assign the name as the part is added therefore adding the index :1,:2,:3 etc.You don't need to deal with creating new/duplicate names.
Next for the constraint replace the static occurrence name with the name linked to the object occurrence added previously.
Component1 = Components.AddContentCenterPart("","Fasteners:Washers:Plain","SS Flat Washers", {"STOCK_TYPE","S","NND","10"}, position := Nothing, grounded := False, visible := True, appearance := Nothing) Component2 = Components.AddContentCenterPart("","Fasteners:Washers:Spring","SS Spring Washers", {"STOCK_TYPE","S","NND","10"}, position := Nothing, grounded := False, visible := True, appearance := Nothing) Constraints.AddMate("", Component1.Name, "Work Axis1", Component2.Name, "Work Axis1", offset := 0.0, e1InferredType := InferredTypeEnum.kNoInference, e2InferredType := InferredTypeEnum.kNoInference, solutionType := MateConstraintSolutionTypeEnum.kNoSolutionType, biasPoint1 := Nothing, biasPoint2 := Nothing) Constraints.AddMate("", Component1.Name, "YZ PLANE", Component2.Name, "YZ PLANE", offset := 0.0, e1InferredType := InferredTypeEnum.kNoInference, e2InferredType := InferredTypeEnum.kNoInference, solutionType := MateConstraintSolutionTypeEnum.kNoSolutionType, biasPoint1 := Nothing, biasPoint2 := Nothing)
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan
Or if this helped you, please, click (like)
Regards
Alan