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.

some featurescript questions

joshtargojoshtargo Member Posts: 241 EDU
  1. How do I return a point where a plane intersects a curve?
  2. I'm doing multiple transforms on a curve, but some transforms are optional. I found it confusing to keep multiplying transforms to build one big final transform, so I want to split it up into steps. I referred to the result of the first transform with qcreatedby, but if some later transforms are optional, I won't necessarily know which function created the curve that needs to be transformed again. How do I refer to the object?
  3. How do I render a line for debug purposes if all I know is the origin and direction vector?
  4. can I render objects (planes, curves, lines, points) in bright orange to help the user visualize what the tool will do?

Best Answers

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,680
    Answer ✓
    1. evDistance
    2. Go with the multiply option, it will be easier and faster
    3. addDebugLine
    4. addDebugEntities

    Senior Director, Technical Services, EMEAI
  • MichaelPascoeMichaelPascoe Member Posts: 1,988 PRO
    edited October 10 Answer ✓

    Like this @josh_targo

    const point1 = WORLD_ORIGIN;
    
    const direction = XY_PLANE.normal;
    const distance = 5 * inch;
    const point2 = direction * distance;
    
    addDebugLine(context, point1, point2, DebugColor.RED);
    


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,680
    Answer ✓

    Or you could simply just debug(context,line(point, direction), DebugColor.RED);

    Senior Director, Technical Services, EMEAI

Answers

Sign In or Register to comment.