Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
Search
-
Re: What is the best way to offset vectors depending if they're positive or negative?
Ok, let's forget about featureScript for a moment. I'm using the user's interface. -I've created sketch 10 -I have no idea what horizontal and vertical are, but who cares -I've worldtosketch these points so now they're in sketch10 coordinate So you know -vector p2-p1 You also know -vector p3-p1 These are the same vector… -
Re: What is the best way to offset vectors depending if they're positive or negative?
Ah, I should have explained. initialComputations is just an arbitrary function that I need to calculate the width of the part so I can use that as the value for the width of the tenon. I am then using that as an editing logic function. However, the variables need to calculate part_wide are also needed in the main body. So… -
What is the best way to offset vectors depending if they're positive or negative?
Hello all, I have come across a peculiar error in my code. I am using a vertex as a reference point for the first corner of an skRectangle(). I am using worldToPlane() to achieve this. I am then adding a vector which is offsetting the first corner in relation to the vertex. It looks like this: skRectangle(sketch1,… -
Re: What is the best way to offset vectors depending if they're positive or negative?
This is the h & width stuff that I'm not sure about: Seems like if it's set up properly, you shouldn't have to worry about direction. Below, the sketch creation scares me. I don't think you have control over the sketch transformation OS is returning and could be flipping horizontal & vertical. I'd feel more comfortable… -
Re: What is the best way to offset vectors depending if they're positive or negative?
That's why I need to determine if h and width should be negative. If the corner coordinates are greater than the centre of the faces, then they are negative, since otherwise I'll be adding a positive offset which will result in the geometry being outside the part. I have changed the code slightly. I am now creating a plane… -
Re: What is the best way to offset vectors depending if they're positive or negative?
I've got it close to working, I didn't need to calculate h and width, just set the planes' x to C-R. The only thing now is the planes' z. It is either +z or -z. How could I specify it to use the positive Z axis. I tried creating a coordinate system which worked, but the plane is in the XY plane, not XZ or YZ. Could I just… -
Re: What is the best way to offset vectors depending if they're positive or negative?
This seems trivial. Pick a face, match tall face edge with width & short with height. Not sure this is always correct. Are you automatically going to find the mating part or does the user pick it. Is it 1 sketch that cuts /extrudes or 2 sketch transforms with each part getting it's own sketch? If you use 2 sketches,… -
Re: What is the best way to offset vectors depending if they're positive or negative?
Well my code already gets p4 so p4-p1 is easy. I think I may have not explained fully. This is the face that I am creating the sketch on. So the normal to sketch 10 in your example is the Y axis. In my picture, the red part should be inside the yellow part like this. To achieve this, I have entered in a horizontal offset… -
Re: What is the best way to offset vectors depending if they're positive or negative?
Lee- Was poking around in your code. I have no solutions to your problem. Just some observations. 1st- change part studio units to meters, it makes debugging this stuff much easier. You can use the measure tool and see which coordinate system your comps object is using. 2nd- I have no idea what this is…
9 results