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.

How can I modify the definition map (as displayed in the annotations) within the code?

joshtargojoshtargo Member Posts: 228 EDU

I'm working on another curve feature, Nudge CP, and want the code to memorize the movements applied to each point. I can make an array of (newpoints - old points), but I don't know to use that array data to populate the annotation fields correctly when the user selects different points to nudge. It seems like the array is ok within the main body, but I can't change the definitions (in the UI) from there. I can from testlogic, but I can't pass anything from the main body to the testlogic function.

I also wanted to

  1. create selectable points, but oppoint only makes them after you commit the function.
  2. make a UI control to select the points on the curve (field, button, etc) but limit the input to the number of CPs on the selected curve.

https://cad.onshape.com/documents/df1467e5ecaa1c85cdfeadad/w/7af7a509f673f8123ca3ed24/e/7e6ff259cee93bb070b08188

Answers

  • MichaelPascoeMichaelPascoe Member Posts: 1,979 PRO
    edited October 15

    0: You have to run the code from within the edit logic. So you would need to put your code within a function that can be called wherever you want.
    1,2: To do this you need manipulator points, which requires manipulator logic.

    Evan's Free Form Spline feature is a great example of how to do all of this.


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • joshtargojoshtargo Member Posts: 228 EDU

    I've been trying everything I can to make this work, but nothing does.

    I just want to be able to go point by point of an existing curve and numerically tell each point to move in our out along it's normal direction.

    is there any way to do this?

Sign In or Register to comment.