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.
My standard content
RyanWiebe
Member Posts: 8 ✭✭
I have created a hot rivet and would like it to behave the same way as the standard content does in assemblies. Is this possible?
0
Best Answers
-
EvanReese Member, Mentor Posts: 2,136 ✭✭✭✭✭you can't make it exactly like standard content, but since you've got it all configured it's pretty similar. Here are some tips to make it more similar:
- make a Variable Studio which corresponds to the holes you need for the rivet, so you can avoid needing to reference a table for them when you're modeling parts for them.
- Assign materials
- Configure the part number and name. You can use the native "Configured Properties" workflow or my Part Name custom feature, which could be more helpful since it's easier to generate the name via some kind of equation.
- tag the document something like "hardware" so that you can get at it really easily from any assembly. When you're searching for parts to add to an assembly with the insert dialogue, and are looking at "other documents", you will see that tag there so you can get to it without needing to search.
Evan Reese1 -
EvanReese Member, Mentor Posts: 2,136 ✭✭✭✭✭Use the Replicate command in the assembly to get a similar patterning thing. You can't do it quite as seamlessly as when inserting from standard content, but it's still pretty dang fast.
As for the name display issue, it's something I may be able to fix inside the feature at some point. I'm aware of some issues with it, like the fact that it fails to "Round formulas" when there are valueWithUnits and not just plain ol' numbers. The reason you see this is that all dimensions in Onshape under the hood are in meters, and Onshape doesn't have infinite precision. That's why you should be just seeing 0.0254m which equals 1 inch, but you get that 2 way out in the gazillionths place. Here's what you've got to do to workaround it for now:- Remove the units using division. For example 1 * inch / inch = 1 or in your case #length / inch = 1
- Round the value to something sensible. For example roundToPrecision(#length/inch, 3) will remove the inch units, and round to 3 decimal places. Be sure to divide by the same units you want to display. For example, if you wanted to show it in millimeters even though the length is typed in inches, you'd divide by millimeter and should get the number 25.4.
- Add extra text. Since you've stripped out the units, you may want to add them back in for the name. You can concatenate strings with ~
"Length-" ~ roundToPrecision(#length/inch, 3) ~ "-Inch"
should give you Length-1-Inch in the part name. You can add the extra text by adding more "string" field to the feature, or just adding them to your equation like the example above.
Evan Reese1
Answers
I’m just not sure why I’m getting the result I am getting…
As for the name display issue, it's something I may be able to fix inside the feature at some point. I'm aware of some issues with it, like the fact that it fails to "Round formulas" when there are valueWithUnits and not just plain ol' numbers. The reason you see this is that all dimensions in Onshape under the hood are in meters, and Onshape doesn't have infinite precision. That's why you should be just seeing 0.0254m which equals 1 inch, but you get that 2 way out in the gazillionths place. Here's what you've got to do to workaround it for now:
- Remove the units using division. For example 1 * inch / inch = 1 or in your case #length / inch = 1
- Round the value to something sensible. For example roundToPrecision(#length/inch, 3) will remove the inch units, and round to 3 decimal places. Be sure to divide by the same units you want to display. For example, if you wanted to show it in millimeters even though the length is typed in inches, you'd divide by millimeter and should get the number 25.4.
- Add extra text. Since you've stripped out the units, you may want to add them back in for the name. You can concatenate strings with ~
Here's how that might play out:"Length-" ~ roundToPrecision(#length/inch, 3) ~ "-Inch"
should give you Length-1-Inch in the part name. You can add the extra text by adding more "string" field to the feature, or just adding them to your equation like the example above.