Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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_Oda
OS Professional Posts: 53 PRO
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).
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.
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.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
}
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.
Tagged:
0