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.

Options

How to set construction line angle?

oleg_bovykinoleg_bovykin Member Posts: 1
Hi! Ive been playing with featurescript and got a problem.
I want to draw a construction line with angle from parameters. But I can't find any definition of dimension for it.
Or should I calculate end point via the angle? That feels like very inconvenient way.

Comments

  • Options
    ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,176
    While you could do this with angle dimensions (using skConstraint with ConstraintType.ANGLE), I expect calculating the endpoint with sin/cos or  will actually be much more convenient -- with the constraint, there's an ambiguity of which of two supplementary angles you mean.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Options
    pierre_grpierre_gr Member Posts: 12 ✭✭
    edited October 2017
    Hi,

    There is little to no doc about skConstraint.

    Is that code supposed to work ?

    <div>skLineSegment(gearSketch, "axis", {"start" : center, "end" : center + vector(0, 1) });
    
    </div><div>skLineSegment(gearSketch, "axisAngled", {"start" : center, "end" : center + vector(1, 0) });
    
    </div><div>skConstraint(gearSketch, "fix1", { "constraintType" : ConstraintType.FIX, "localFirst" : "axis" });
    
    </div><div>skConstraint(gearSketch, "constraint1", {"constraintType" : ConstraintType.ANGLE, "localFirst" : "axisAngled", "localSecond" : "axis", "angle" : 5 * degree});
    
    skSolve(gearSketch);</div>


    In my case, I'm still getting a 90deg angle between the two axis.

Sign In or Register to comment.