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.

using "Item label template" to number array items

Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
I'm trying to name each item in an array parameter. My first thought was to add a hidden Count Parameter and update it with editing logic, which works, but doesn't update with you just click the button to add a new item. It waits till I change something else. Is there another way to do this? I might be overcomplicating it.
Evan Reese / Principal and Industrial Designer with Ovyl
Website: ovyl.io

Best Answer

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    Answer ✓
    Can you link the code? Unless I'm misunderstanding, adding a new array item should rerun the editing logic function and allow the hidden parameters to be set.

Answers

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    Answer ✓
    Can you link the code? Unless I'm misunderstanding, adding a new array item should rerun the editing logic function and allow the hidden parameters to be set.
  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    Thanks, Kevin. Just knowing that's a reasonable approach made me check my code again and I found I the editing logic for this was inside of a big if() that was giving the odd behavior I'm describing. So editing logic is your recommended solution for this though?
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    Currently array item names depend only on feature parameters, so yes, I think editing logic is the only available solution. Feel free to submit an improvement request to introduce a syntax for including the item number!
  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    Thanks, If it seems to come up more often, I'll do that.
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
Sign In or Register to comment.