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.
opExtrude opposite direction
john_mcclary
Member, Developers Posts: 3,936 PRO
How can you set the opposite direction of opExtrude for a blind cut?
i see there is an opposite direction in extrude() but that just fails completely when i change opExtrude to extrude
opExtrude(context, id + "extrude", {
"entities" : qCreatedBy(id + "slotSketch", EntityType.FACE),
"direction" : slotPointPlane.normal,
"endBound" : BoundingType.BLIND,
"endDepth" : distance<br>
});
i see there is an opposite direction in extrude() but that just fails completely when i change opExtrude to extrude
0
Best Answers
-
kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565For that case you want to multiply the direction by -1 like
"direction" : slotPointPlane.normal * -1<div></div>
or do it conditionally like"direction" : flip ?
slotPointPlane.normal : -slotPointPlane.normalSince endDepth and startDepth are required to be positive, you can't just flip the extrude depth, you need to flip the direction.
Also note that the start boundary can be flipped, independently from the direction, with the isStartBoundOpposite field.5 -
john_mcclary Member, Developers Posts: 3,936 PRO@MBartlett21 jumped into my script and fixed it up, Thanks
Now that it is complete: anyone who wants to use it, here you go
https://cad.onshape.com/documents/5afccd5ef566ebe0825bd897/w/395df9e1dbce13694707fcc6/e/6d242fc93553ab288e2447ae
It lets you create a slot similar to SW's hole wizard
You select points (or mate implicit mate connectors)
Then set the diameter
Then the length (center to center)
Then a direction (in this case they are following the diagonal line)
I've been using it for a long time now, works great. Now that it is complete I've made it public.
4
Answers
"direction" : flip ?
slotPointPlane.normal : -slotPointPlane.normalSince endDepth and startDepth are required to be positive, you can't just flip the extrude depth, you need to flip the direction.Also note that the start boundary can be flipped, independently from the direction, with the isStartBoundOpposite field.
yea, that was the first thing I tried, and I must have had a typo, because it would just turn fail and turn the feature red... so i've been chasing my tail looking for an alternative way....
I get the same problem when I tried to use isStartBoundOpposite..
That's one end bound down... now i need to get symmetric, up to face, up to vertex, through all (in only one direction, not both directions)...
What am I doing wrong?
<br><div><strike>else if (definition.endType == EndType.UP_TO_VERTEX)</strike></div><div><strike> {</strike></div><div><strike> opExtrude(context, id + "extrude", {</strike></div><div><strike> "entities" : qCreatedBy(id + "slotSketch", EntityType.FACE),</strike></div><div><strike> "direction" : slotPointPlane.normal,</strike></div><div><strike> "endBoundEntity" : qNthElement(definition.upToVertex, 0)</strike></div><div><strike> });</strike></div><div><strike> }<br><br></strike><div><strike>else if (definition.endType == EndType.SYMMETRIC)</strike></div><div><strike> {</strike></div><div><strike> opExtrude(context, id + "extrude", {</strike></div><div><strike> "entities" : qCreatedBy(id + "slotSketch", EntityType.FACE),</strike></div><div><strike> "direction" : slotPointPlane.normal,</strike></div><div><strike> "endBound" : BoundingType.BLIND,</strike></div><div><strike> "startBound" : BoundingType.BLIND,</strike></div><div><strike> "endDepth" : distance</strike></div><div><strike> });</strike></div><div><strike> }</strike></div></div>
Edit:
That didn't format correctly, here is an image of what It looks like in the post editor:
All I need is up to vertex and I'm good
What are you making?
IR for AS/NZS 1100
I'll share it with you if you want to look at it.
All thats left is up to vertex end condition
I'd like to see it.
-Morgan
IR for AS/NZS 1100
Now that it is complete: anyone who wants to use it, here you go
https://cad.onshape.com/documents/5afccd5ef566ebe0825bd897/w/395df9e1dbce13694707fcc6/e/6d242fc93553ab288e2447ae
It lets you create a slot similar to SW's hole wizard
You select points (or mate implicit mate connectors)
Then set the diameter
Then the length (center to center)
Then a direction (in this case they are following the diagonal line)
I've been using it for a long time now, works great. Now that it is complete I've made it public.