Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Not focused entity is displayed in focus color

Toshimichi_OdaToshimichi_Oda OS Professional Posts: 31 ✭✭
Entity of 'definition.xxx is Query' is displayed in 'Focus Color' in graphic screen when editing feature, even if it is not focused and not displayed in feature dialog.

For example, feature 'MyBox' makes a box solid by

   OneOrTwoPoint: by selecting one or two points.
or
   SIZE  : by specifying size(length values).

annotation { "Feature Type Name" : "MyBox" }
export const myBox = defineFeature(function(context is Context, id is Id, definition is map)
    precondition
    {
        annotation { "Name" : "Box Type" }
        definition.myBoxType is MyBoxType;

        if (definition.myBoxType == MyBoxType.Size) {
            annotation { "Name" : "X" } isLength(definition.x, LENGTH_BOUNDS);
            annotation { "Name" : "Y" } isLength(definition.y, LENGTH_BOUNDS);
            annotation { "Name" : "Z" } isLength(definition.z, LENGTH_BOUNDS);
        } else {
            annotation { "Name" : "Point(s)", "Filter" : EntityType.VERTEX, "MaxNumberOfPicks" : 2 }
            definition.twopoints is Query;
        }
    }

    {
        var points=makeArray(2,vector(0,0,0)*meter);
        if (definition.myBoxType==MyBoxType.Size) {
            points[1]=vector(definition.x,definition.y,definition.z);
        } else {
            var q=evaluateQuery(context, definition.twopoints);
            for(var i=0;i<size(q);i+=1) points[i]=evVertexPoint(context, {"vertex" : q[i]});
        }
        fCuboid(context, id+"myBox",{"corner1":points[0],"corner2":points[1]});
    });

export enum MyBoxType {
    Size,
    OneOrTwoPoint
}

After creating 'myBox' by OneOrTwoPoint,  I edit to change to SIZE.
In graphic screen, the two points remain to be displayed in focus color though 'definition.twopoints' is not focused and not displayed in dialog and cannot be changed by clicking other entities when SIZE is selected.


Sign In or Register to comment.