-
Notifications
You must be signed in to change notification settings - Fork 2
/
compositePart.fs
35 lines (31 loc) · 1.37 KB
/
compositePart.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FeatureScript ✨; /* Automatically generated version */
// This module is part of the FeatureScript Standard Library and is distributed under the MIT License.
// See the LICENSE tab for the license text.
// Copyright (c) 2013-Present PTC Inc.
// Imports used in interface
export import(path : "onshape/std/query.fs", version : "✨");
// Imports used internally
import(path : "onshape/std/feature.fs", version : "✨");
import(path : "onshape/std/transform.fs", version : "✨");
/**
* Feature that creates a composite part from provided bodies. Performs an [opCreateCompositePart].
*/
annotation { "Feature Type Name" : "Composite part" }
export const compositePart = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
annotation { "Name" : "Entities", "Filter" : EntityType.BODY && ModifiableEntityOnly.YES && AllowMeshGeometry.YES && SketchObject.NO }
definition.bodies is Query;
annotation { "Name" : "Closed", "Default" : false }
definition.closed is boolean;
}
{
const remainderTransform = getRemainderPatternTransform(context, {
"references" : definition.bodies
});
if (remainderTransform != identityTransform())
{
throw regenError(ErrorStringEnum.PATTERN_FEATURE_FAILED);
}
opCreateCompositePart(context, id, definition);
});