Splitting Parts Removes Attributes

Cappie_Pomeroy
Cappie_Pomeroy Member Posts: 14 ✭
edited November 2020 in FeatureScript
"Attributes stay with the entity they are defined on, even as the Part Studio changes. An attribute on a face, edge, or body which is split in two will be set with the same name and value on both split pieces."

However, the following feature script.
FeatureScript 1403;
import(path : "onshape/std/geometry.fs", version : "1403.0");
annotation { "Feature Type Name" : "My Feature" }
export const myFeature = defineFeature(function(context is Context, id is Id, definition is map)
precondition
    {
        // Define the parameters of the feature type 
       annotation { "Name" : "My Query", "Filter" : EntityType.BODY, "MaxNumberOfPicks" : 1 }
        definition.myQuery is Query;
    }
    {
        // Define the function's action
        setAttribute(context, {
                "entities" : definition.myQuery,
                "name" : "myName",
                "attribute" : "myValue"
        });
        debug(context, getAttributes(context, {
                "entities" : qEverything(EntityType.BODY),
                "name" : "myName"
        }), DebugColor.BLUE);
        opPlane(context, id + "plane1", {
                "plane" : plane(XY_PLANE.origin, XY_PLANE.normal)
        });
        opSplitPart(context, id + "splitPart1", {
                "targets" : definition.myQuery,
                "tool" : qCreatedBy(id + "plane1", EntityType.BODY)
        });
        debug(context, getAttributes(context, {
                "entities" : qEverything(EntityType.BODY),
                "name" : "myName"
        }), DebugColor.BLUE);
    });

Will log:

debug: [ "myValue" ]
debug: []
  Result: Regeneration complete

What am I missing?  The attribute is being completely removed it doesn't stay on either body after the split let alone both like the docs say.  I hope that I'm doing something wrong or that this is a bug because it would be very useful for me if the attributes stay on both bodies.



Comments