A question on preconditions.

darren_13
darren_13 Member, Developers Posts: 120 PRO
Can I somehow separate the preconditions out of the main function? 

there are two reasons I wish to do this:
  1. it's getting too long and messy.
  2. I want to take a precondition of queries and split it and return it in two separate definition maps i.e. definition.plane and definition.lines, I could split it into two queries from the start but I wanted it in 1 query to reduce clicks.
the reason I wouldn't split this in the main function is that I then want to use the new array UI on just the definition.lines. 

If 2 is not possible I can work around but number 1 would be good.

Many thanks,
Darren
Tagged:

Comments

  • lana
    lana Onshape Employees Posts: 782 image
    1. You can write a predicate and use it as a line in precondition. See 

    booleanStepScopePredicate() implemented in boolean.fs and used in extrude and other features precondition.

    2. Precondition can't change definition, so you'll have to split your input with qGeometry() filter inside the feature