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's the best way to get info to editing logic?

EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
I am calculating some values in my feature that I'd like to reference in my editing logic. What's the easiest way to pass them in? I thought I might be able to just add them to the definition, but it doesn't seem to come through.
Evan Reese

Answers

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,683
    The only thing you can do is to put the calculations into a function and call the function from your feature definition and editing logic (so it runs twice basically - not very efficient, but that's the only way I know of).
    Senior Director, Technical Services, EMEAI
  • EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
    Thanks, Neil. That's what I've done in the past, but it was especially cumbersome in my current case so I thought I'd poke at it again. Even still, there's probably something way more elegant and less copy/pastey for what I'm doing, but it's working now 🤷‍♂️.

    For any future readers, it seems like the reason you can't just add items to "definition" and get them in editing logic is because the editing logic runs before the feature itself, not after, so anything added to "definition" in the feature won't be there yet.
    Evan Reese
Sign In or Register to comment.