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.

Featurescript - Manipulator

Hugh_GoodbodyHugh_Goodbody Member Posts: 40 PRO
I have instantiated a part in a part studio using feature script. In the picture it is the port at the rear of the cylinder. I would like a manipulator to allow the user to graphically rotate the port around the cylinder to the desired position. The snippet I have tried is:

var testPoint = vector(-capPortPos,0,0)*millimeter;

angularManipulator({
        "axisOrigin" : testPoint,
        "axisDirection" : X_AXIS,
        "rotationOrigin" : vector(-capPortPos,0,10)*millimeter
});

Where testPoint is the blue dot.
Am I on the right track?





Comments

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    @Hugh_Goodbody
    It seems like you're on the right track. You'll next need to add that manipulator with the addManipulators() function, and control its effect with a manipulator change function.

    A full working example (and IMO the best place to start) is in the documentation for the manipulator module.
  • Hugh_GoodbodyHugh_Goodbody Member Posts: 40 PRO
    I am getting the following error:
    Precondition of angularManipulator failed (is3dDirection(definition.axisDirection))

    Are there any examples using the angular manipulator?

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    The X_AXIS is a Line (which specifies both a direction and an origin point) while axisDirection wants a direction.

    You can instead use X_AXIS.direction, or X_DIRECTION, or vector(1, 0, 0), which are all the same thing: A unit vector pointing in the positive x direction.
Sign In or Register to comment.