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.
Extrude separate adjacent shapes
emory_krall
Member Posts: 15 PRO
Does anyone know of a way to extrude two or more adjacent sketch outlines as separate objects? I often need to do this and wind up making several separate extrude features, but it would be much quicker and simpler if there was a featurescript or something that would do it in one operation.
Tagged:
2
Best Answer
-
Jake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646Jake Rosenfeld - Modeling Team4
Answers
You mean like this?
https://cad.onshape.com/documents/d227788a2cb87e323b137a39/w/75adf83fcc68513e42d65e6e/e/937116e9df75d574d6e8cc04
Cheers, Owen S.
HWM-Water Ltd
I think the op is just asking for a custom feature that will extrude each face of the input as a separate body. Unfortunately I don't have time to hack this up at the moment...
Basically make the user supply the same definition as extrude takes, then apply to each entity separately (with some id finagling).
Some semantic sugar also:
'definition.entities' is the same as 'definition["entities"]'
ternary operator (var a = condition ? this : that): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
Thanks again @Jake_Rosenfeld
For 10 points name another CAD company that will write you two new free features with 24 hours of asking...
Cheers,
Owen S.
HWM-Water Ltd
Thanks for the kind words, glad I could help! I've pushed a V2 with a very small fix that makes references to the created bodies more stable.
There's also some weirdness with the "entities" box (you may notice all of your selected faces collapsing into one selection called "Missing of sketch X"). This should not be a huge problem as selections/deselections should act as usual in the graphics are. We are investigating this as it seems like a systematic issue, hopefully it doesn't cause too much inconvenience.
IR for AS/NZS 1100
Yup, it's caused by the Id, but if I don't piggyback off the Id in that way, I'd have to do extra work to have the manipulators (or just not have them at all).
Thank you @Jake_Rosenfeld! I'm using OnShape to make a stained glass window pattern (of all things) but as you might imagine, your script just saved me a ton of time!
Glad to help @paul_bunnell !