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.

What happens with patterns and preconditions?

S1monS1mon Member Posts: 2,244 PRO
edited July 2022 in FeatureScript
I'm noticing some behavior with @Evan_Reese's 3D Point where a pattern of points silently creates no point when "Location on curve" goes slightly over 1.0, and then any feature (say a plane) which is dependent on that point does weird stuff. Normally if you are entering a value into the feature, the precondition limits the value to [0...1.0]. It seems like when that value is set with a varying "linear" pattern, that the precondition doesn't do anything. (I'm just using the pattern to iterate through the features).

annotation { "Name" : "Location on curve", "UIHint" : UIHint.MATCH_LAST_ARRAY_ITEM }
isReal(vertex.curveParameter, { (unitless) : [0, .5, 1] } as RealBoundSpec);
I checked with a simple variable and a single point, and increasing from 1.0 to 1.1 causes the 3D Point feature to fail, but in a pattern, nothing fails, it just has very unexpected downstream behavior.

Is there some reason why patterns don't trigger the precondition tests? Do features need extra bounds checking on inputs to avoid this kind of thing?

Here's a really simple example:

Range set to 1, and the pattern works as expected

Here it is with the range set to 1.01, and the last point silently fails (although the FeatureScript notices show errors), but the plane does something completely unexpected.


  • Evan_ReeseEvan_Reese Member Posts: 2,056 PRO
    No idea what's going on behind the scenes, but commenting here to come along for the ride while you find out.
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
Sign In or Register to comment.