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.
Duplicate feature parameter's'
Toshimichi_Oda
OS Professional Posts: 53 PRO
Error occurred, but I do not think it is not an error.
Duplicate feature parameter's'
I use duplicated name of inner parameter of array, but names of two arrays are different.
It is not serious for me because I am good to change the name.
export const myFeature = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
annotation { "Name" : "Widgets", "Item name" : "Widget", "Item label template" : "#myParameter" }
definition.myWidgets is array;
for (var widget in definition.myWidgets)
{
widget.arrayItem is string;
}
annotation { "Name" : "Widgets", "Item name" : "Widget", "Item label template" : "#myParameter" }
definition.myWidgets2 is array;
for (var widget in definition.myWidgets2)
{
widget.arrayItem is string; // when change to "widget.arrayItem2", no error
}
}
{
});
Maybe namespace of each item of array is not exist .
0
Comments
This sounds like na error on our side. Thank you for pointing it out.
definition
map).Yes, this is more of a known limitation than an outright bug.
So I think it is not serious.
In precondition, I make the same two preconditions to be made to a function.
One is out of array, another is with in array-loop.
export const testCallPredicate1 = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
stringPredicate1(definition); //out of array
}
{
});
annotation { "Feature Type Name" : "testCallPredicate3" }
export const testCallPredicate3 = defineFeature(function(context is Context, id is Id, definition is map)
precondition{}
{});
annotation { "Feature Type Name" : "testCallPredicate2" }
export const testCallPredicate2 = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
annotation { "Name" : "Widgets", "Item name" : "Widget", "Item label template" : "#str" }
definition.myWidgets is array;
for (var widget in definition.myWidgets)
{
stringPredicate1(widget); // within array-loop // Error!
// stringPredicate2(widget); // no error!
}
}
{
});
predicate stringPredicate1(definition)
{
annotation { "Name" : "str" }
definition.str is string;
}
predicate stringPredicate2(widget)
{
annotation { "Name" : "str" }
widget.str is string;
}
for (var definition in definition.myWidgets)
{
stringPredicate1(definition); // no error!
}