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.

Can someone explain ""Editing Logic Function" to me?

dave_cowdendave_cowden Member, Developers Posts: 445 ✭✭✭
I have seen that it possible to run logic when the user interacts with the definition. In the hole feature, it is used to update the values of numeric input boxes when the user choose standard hole sizes.

I can see an example in the source for the hole operation, but it is extremely confusing to follow. 

What is 'isCreating'?  'specifiedParameters'? hiddenBodies?

As far as I can see, this functionality is not documented anywhere. Am i missing it? If not, can someone give some high level guidance on how exactly this works? 

Best Answers

Answers

  • dave_cowdendave_cowden Member, Developers Posts: 445 ✭✭✭
    .. As a followup, and more specific question: I assume that 'oldDefinition' are the value after the user makes the change. and 'definition' is the new one. But then what is 'specified Parameters'? and then what is done with the return value of the function?

    Essentially there are 4 maps involved: oldDefinition, definition, the return value of the function, and specfiedParameters. 

    Its pretty difficult to figure out the semantics of such a complex signature.
  • dave_cowdendave_cowden Member, Developers Posts: 445 ✭✭✭
    Alright, i played with this a bit longer, and I think i understand the basics of this now:

    oldDefinition is, in fact, the old version of the definition, before the user made the change

    definition is the new one, after the user's changes

    specifiedParameters is a map that indicates whether the user has ever manually interacted with this parameter. IE, if a value was provided by default, or by code, specifiedParameters[paramname] is false. Once it is true, it is always true, even if the value is changed from what the user originally provided

    isCreating is true when a feature dialog is first open to create the feature, and false thereafter.

    Is this right? I still dont know what 'hiddenBodies' is for
  • dave_cowdendave_cowden Member, Developers Posts: 445 ✭✭✭
    ah ok!  very intersting!  so if i do qEverything() and subtract the hiddenBodies, i get what the user can actually see?  that's useful..
Sign In or Register to comment.