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.
Can someone explain ""Editing Logic Function" to me?
dave_cowden
Member, Developers Posts: 475 ✭✭✭
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?
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?
0
Best Answers
-
ilya_baran Onshape Employees, Developers, HDM Posts: 1,211That's exactly right except that specifiedParameters is whether the user manually interacted with the parameter during the current feature edit (as opposed to ever). hiddenBodies is a query for all bodies that are currently hidden (so that our extrude feature for instance doesn't try to boolean with something the user can't see).Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc6
-
ilya_baran Onshape Employees, Developers, HDM Posts: 1,211Yes, qEverything(EntityType.BODY)Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc5
Answers
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.
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