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.
FeatureScript: Bounding Box Sketch
john_mcclary
Member, Developers Posts: 3,935 PRO
Is there a way to create a bounding box sketch on the flat pattern view of sheet metal?
I need it for the stock size call out on the drawings, kind-of a pain in the arse doing it manually.
I need it for the stock size call out on the drawings, kind-of a pain in the arse doing it manually.
Tagged:
1
Best Answers
-
emagdalenaC2i Member, Developers, Channel partner Posts: 863 ✭✭✭✭✭Here is a sample
Un saludo,
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común7 -
MBartlett21 Member, OS Professional, Developers Posts: 2,045 ✭✭✭✭✭@john_mcclary
@mahir
@emagdalenaC2C
Try out @Jake_Rosenfeld 's fs, which I have added flat pattern compatibility to: https://cad.onshape.com/documents/2ce3e64026df1ac7e63b98bd9 -
MBartlett21 Member, OS Professional, Developers Posts: 2,045 ✭✭✭✭✭john_mcclary said:That's cool, but it doesn't auto calculate the minimum stock size, and also does not allow you to insert the bounding box sketch into a drawing view
Please update to V 4.7, which adds auto-calculation to the feature5 -
john_mcclary Member, Developers Posts: 3,935 PROIndeed it does,
Thank you all for your help, I will use the following workflow:
1) Use: V4.7+ of https://cad.onshape.com/documents/2ce3e64026df1ac7e63b98bd/w/7a2029e15b241c80c591a492/e/466a1aa41fce0c0be07f6436
2) Calculate Smallest on flat pattern
3) Create a secondary sketch and "Use" the result of featurescript
4) Insert into drawings
5) Win
2 -
emagdalenaC2i Member, Developers, Channel partner Posts: 863 ✭✭✭✭✭well, actually the material and their density is set in a csv file... https://cad.onshape.com/documents/2718281828459eacfeeda11f/w/97628b48cc974c2681faacfc/e/6bbab304a1f64e7d640a2d7d
So, you can create a CSV reference parameter to read the material information ;-)Un saludo,
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común7
Answers
Does it need to be a sketch?
IR for AS/NZS 1100
In the sheet metal flat view you only can create sketches
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
I am not sure... but I think we can't create a sketch in the Sheet metal flat view from a FeatureScript
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
In this picture the small rectangle is a sketch in the sheet metal flat view created from a FeatureScript ;-)
So now we only need to calculate the bounding box to drawn it in the sketch
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
Step 1 - Create a sketch in the sheet metal flat view (DONE)
Step 2 - Calculate the bounding box (In progress)
Step 3 - Create the sketck (Pending)
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
Now,
-Transform the sketch to be in the right position
-Change to construction geometry
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
I might actually makemake some improvements to it
IR for AS/NZS 1100
IR for AS/NZS 1100
I break everything i touch >_>
@mahir
@emagdalenaC2C
Try out @Jake_Rosenfeld 's fs, which I have added flat pattern compatibility to: https://cad.onshape.com/documents/2ce3e64026df1ac7e63b98bd
IR for AS/NZS 1100
@john_mcclary calculate the minimum stock size...
Are you talking about the optimization of the sheet metal
And, insert the bounding box sketch into a drawing view
Why you need that?
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
We look over all the details and if I did not show the bounding area of the part as shown below. Then someone asks "will that fit on a sheet?" (58 1/2" x 119") I can point to the "stock size" and say "Yes, We will have ~6 1/4" remaining, but we can only get one on a sheet".
And if i just add it to the stocksize on the detail callout note without dimensional proof on the part. Then it can slip through the cracks because Onshape will not let me add stocksize automatically to a custom property. So hand typed information needs a double check on paper.
Also, you can edit the FS and show a message, or don't create the sketch if the size dono't fit on a sheet.
https://cad.onshape.com/FsDoc/library.html#module-properties.fs
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
Yes you can modify some pre-set properties, but not Custom properties.
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
I used to do that trick before I had a company set up; mainly for the use of custom properties. So they are actually labeled to match their content.
It was a pain in the arse remembering which property "Title3" was really being used for "Mass"
On top of that I ran out of properties pretty quick what you see there is just the last 5 properties that are attached to every part, I was typing out the stocksize on the sheet manually then. I have it in a property in hopes Onshape will eventually let us FS-edit custom properties as well; at that point I will have the weight, stocksize, etc. all derived directly in the part stuido. (just like I did in SW)
Twitter: @onshapetricks & @babart1977
But I have began attempting to make a featurescript to do this automatically by:
evVolume(context, { "entities" : definition.bodyQuery })
then reading the material property (I hope I can extract a density from this directly from the material library.... but I doubt it)
Then I was going to multiply them together and save the result in my custom property.
But luckily I look ahead and saw I couldn't save to a custom property, so I have up after getting the volume...
I think it isn't recognising it as a sketch because of it being in a custom feature.
Maybe @lougallo could explain why.
P.S.
If you create a sketch then 'use' the edges, it can then be inserted into a drawing.
IR for AS/NZS 1100
IR for AS/NZS 1100
@emagdalenaC2C
I have made an improvement request for sketches created by custom features in the drawing view:
https://forum.onshape.com/discussion/9655/allow-flat-sketches-from-custom-features-in-drawings
IR for AS/NZS 1100
Please update to V 4.7, which adds auto-calculation to the feature
IR for AS/NZS 1100