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.

Mouse Interface

emerson_botteroemerson_bottero Member, Developers Posts: 37 ✭✭
All documentation I could find shows example using coordinates, like rectangule vector (0,0) vector (1,1), but if I want the user to select with the mouse the first and second point How can I do that?
Tagged:

Comments

  • traveler_hauptmantraveler_hauptman Member, OS Professional, Mentor, Developers Posts: 419 PRO
    You can use a query, the user will be able to select pre-existing points.
  • emerson_botteroemerson_bottero Member, Developers Posts: 37 ✭✭
    Yes but then the user would have to make an sketch only to create the point, what I want is that my feature start a sketch and the user then creates the points, add some dimensions and then click the feature Ok button. Is more fluid.
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,062 PRO
    I'm not sure I understand your question.

    Do you want a line in 3D space or in a sketch?

    If you want to create a line in space without a sketch, then you use a query to select 2 vertices, then a 3dspline which returns a line if only 2 vertices are selected, so I've been told. As a result, you'll have a 3D line in space that couldn't be created using the user interface.

    One thing you have to understand is featurescript doesn't work like OS. You're one level down. You can create things here that can't be created in OS. It's not a macro language so featurescripts are not constructed like a user would create geometry through the user interface.

    I don't think I'm helping here,


  • traveler_hauptmantraveler_hauptman Member, OS Professional, Mentor, Developers Posts: 419 PRO
    Yes but then the user would have to make an sketch only to create the point, what I want is that my feature start a sketch and the user then creates the points, add some dimensions and then click the feature Ok button. Is more fluid.
    Yes, I agree that this would be more fluid. The way that onshape is currently organized does not allow for this.
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,062 PRO
    edited May 2016
    I think I understand now. traveler please tell me if I'm in left field.

    All CAD systems are limited to that 2D Flat monitor you're staring at. The cursor rides on a view plane that's parallel to the screen. When you pick something, the display list returns objects under the cursor (those 3D things)  and eventually you'll end up with vector (1,1,1) or some 3D value. Without something on the screen to pick, you don't get 3D. Another way to say it is that you can't use a 2D display to pick a 3D point. This ain't a 2D CAD system. You can't just pick on the screen without setting it up.

    You're showing 2D vectors so some how your cursors on a plane like a sketch. You have to define this plane/sketch 1st. Then I think your logic will work. Create a sketch on the front plane and then you'll be happy. Just remember that there's a transformation allowing you to do this and a sketch filters the Z component allowing you to create points with a mouse. If you create a sketch on the correct plane (can't remember which way is up), then the transform is the identity matrix:

    1 0 0 1
    0 1 0 1
    0 0 1 1
    0 0 0 ?

    (I think I had this matrix wrong. The 3 number 1's on the right are the scaling values and most times they are set to 1, meaning that after the transformation, the new coordinate system has the same scale as the one you just left.)


    I haven't used any sketch functions yet and can't tell you how they work. There are plenty of threads here talking about them.

    I create a lot of points inside OS but not at mouse cursor locations. One thing that I wanted is the ability to pick these points with my mouse, which I can, and the system tells me where I'm at in 3D space ie... vector (.1,.2,.1). More technically I'm creating curves through these points and reverse engineering complex shapes.

    I think you're mixing up 2D & 3D.

    Maybe what's missing is a basic intro into linear algebra & 3D CAD. Now that featurescript is mainstream and the general population thinks 2D (why was ACAD ever popular?) maybe today we begin showing the world what 3D CAD is all about.

    emerson I don't mean to insult you. I just don't understand your question. If you want I'll create and show you how to do what your wanting. I need to learn featurescript sketches.



  • emerson_botteroemerson_bottero Member, Developers Posts: 37 ✭✭
    Billy, I didn't felt insulted, if you are answering then it means you are trying to help. I use Cad since 1999 and selecting a point in a sketch at the mouse position is basic, of course selecting a plane/surface is a precondition.
    See in this video exactly at 1:31 the user is selecting a point in plane, it doesn't matter if the view is normal to plane ,that's optional, and there was no preexisting points to select. 

    In my feature, imagine that when selecting a plane it automatically creates a sketch with the command to create a point activated.

    PS.: In Solidworks and inventor there is a 3D Sketch tool so even the plane is not precondition, but is not what I want here, just for you to know, so you can pick a 3D point in a flat screen, the deference is you have less control over it until you put constraints like on Z plane. Solidworks Inventor
    UI.png 11.6K
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,210
    @emerson_bottero
    I think the workflow that you're asking for makes sense (Traveler suggested something similar here: https://forum.onshape.com/discussion/comment/17381/ ) but it's not yet possible in Onshape.  Having a vertex query and the user having to precreate sketches is probably the best workaround for now.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • emerson_botteroemerson_bottero Member, Developers Posts: 37 ✭✭
    Thanks ilya.

    I thought it was possible because in sketches inside Onshape you have that capability so there should be a code that implements it but none of the FS examples shows it.
    I will go with the workaround suggested.

    Thanks.
Sign In or Register to comment.