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 that generates a cube by specifying desired mass (carbon steel)
STEG
Member, User Group Leader Posts: 103 PRO
Hi everyone,
This is my first FS ever and I developped it just for the fun of learning FS.
The feature builds a cube by specifying the desired mass (in kg). The density used is for carbon steel.
There is an option to center the cube on the center point in the PS.
I already have improvements ideas such as:
Any improvement idea?
Anyone find this cube useful?
This is my first FS ever and I developped it just for the fun of learning FS.
The feature builds a cube by specifying the desired mass (in kg). The density used is for carbon steel.
There is an option to center the cube on the center point in the PS.
I already have improvements ideas such as:
- Units selection (kg or pounds)
- Set the name of the part to something like: [mass] ~ [units] ~ [Material] ~ "Cube"
- Selection of regular shapes (cube, sphere, half sphere, regular cylinder, tetrahedron)
- Improve icon
- Materials selection (steel, aluminum, brass, etc)
Any improvement idea?
Anyone find this cube useful?
Tagged:
3
Comments
Oo your first feature has an icon
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
It seems like an easy next-step is to add a place to type in your material density. It's maybe a little more cumbersome to use than a whole material library, but it would make it unlimitedly flexible.
Eventually, you could add a dropdown with all the materials you want and when you pick one, it could change the density value, or if you change the density value it would set the material dropdown to say "custom" kind of like the hole feature. This would use the Editing Logic Function which you can read about here.
I particularly like this:
If you decide to implement it, and want any pointers on structure ahead of time, or get stuck. I'm happy to help and I know others would be too. One hint is to make a map with all of your materials and densities (ignore my nonsense numbers):
Then you can get at them with the enum from the drop down something a bit like this. This exact code may not be right, I've not checked, but the idea is there.