Megaimportant wish: Weight measurement

This isn’t exactly what’s being requested, but this method is fairly easy to do without any additional plugins in Rhino 7.0 using text functions and/or User Text.

5 Likes

I did this as a plug-in in V4 … just couldn’t put the time in to update it in v5/v6.
But here is a quick tool… http://www.finelt.com/toolsproject/pmvc.htm
And many other CAD programs have all this built-in.
What’s up @pascal
Send me an email and I’ll send you the spreadsheet (xls).

1 Like

Still no way to calculate mass of models in Rhino 7?

1 Like

Actually, Bobi, that is possible in Rhino 7.
It’s not necessarily easily discoverable but it is documented here: Convert strings to numbers

You can store the density of a material in an attribute user text key-value pair on an object, retrieve the volume of that object with a text field and then multiply both with:
%<Volume("ObjectID") * float(UserText("ObjectID", "Density"))>%
-wim

2 Likes

This works in Rhino 7 because the text between %< and >% is evaluated using python and float is a built in function in python for converting a string into a number

1 Like

Wow, this sounds so complex and difficult to remember. May I ask you to make a short tutorial video showing the mass calculation of two objects, one of steel and the other from aluminum?
Having a simple-to-use mass calculation is a must for a program of this caliber, and it’s pity that up until Rhino 6 there was not a dedicated tool for this, other than relying on 3rd party scripts and plug-ins.

By the way, I just figured out that there is a new version of the Peter’s tools plug-in released 10 days ago that finally works in Rhino 7! :slight_smile: I tried it an it does its job exactly as it did in Rhino 5 and Rhino 6 years ago. I strongly recommend this plug-in to anyone who is doing design for manufacturing. It also has a BOM function that could copy and export the properties of objects (including individual mass) into a spreadsheet.

2 Likes

I agree this is much to difficult and complex. The hope is to eventually provide an improved user interface so equations like this would be easier to set up. We are just showing that this is possible in Rhino 7.

You can also take an inspiration from the “Peter’s tools” plug-in. It’s very convenient to use and it will be great if Rhino 7 offers similar functionality for material mass properties and BOM export. The only things that I would recommend are:

  • Make it possible to remember the settings. For example, the dialog box of “Peter’s tool” pops every time and it will not remember the previous user’s choice, which takes several extra mouse clicks each time the mass measurement tool is used.

  • Make a pop-up window with a vertical list of the selected parts whose mass properties were evoked (similar to the “Notes” window in Rhino). The text field must be possible to copy in the clipboard or saved as a txt or rtf file.

  • Add a selection tool to select geometry with assigned mass properties. Even better if it’s possible to select objects with a certain type of material type (steel, aluminum, plastic, glass, rubber, gold, silver, etc). For example, if at least one object with an applied material is selected (like aluminum), the “Select objects with same material” command should select every other object with aluminum material properties.

  • Add these to the Analysis toolbar next to “Volume”, “Area” etc.

  • Use a funny icon for the “Mass” tool (if you wish). :smiley: Like this one:
    Badass mass 1
    Badass mass 2
    Badass mass 3

2 Likes

Is R8 the place that the “Materials” object starts storing other material properties besides visual ones? Like elastic, magnetic and thermal expansion properties that can, if the user desires, automatically be available for downstream analysis as soon as a material is assigned to an object. Perhaps others that are useful to other users. Of course a first class implementation would also integrate it with the unit change conversion system.

1 Like

Hi,
Good wishes.
I can’t believe McNeel is so nit picky about adding this one tiny feature instead they make a grandiose gesture with some complicated roll it yourself attitude. Ok I got my own scripts I wrote but come on make this a feature by now it’s not hard.

Also its time to add more spreadsheet like capabilities in rhino and quit telling users to use python and eto forms that’s like sculpting a toothpick with a jackhammer. McNeel please make a csv exportable little spreadsheet tool, that we can attach data to and do calculations in. In fact we spoke about this for V3 when block management was introduced. You could actually do away with many of the tabs if you had a really good spread sheet tool that could list object properties, materials, block counts etc. and that could accept formulas to act on cells. You could do away with the clumsy and archaic block editor. I’m sure there’s free libraries by now McNeel could compile. This is also where the weight calculations could go. Block management, path information it’s endless. All that data that can all be called by methods why can’t it all be hooked up within a spreadsheet format, something easy not like Gh and python.
RM

Or a kettlebell: :sunglasses:
image

A command to select objects by material should be easy to fix since it already exists (in the materials tab when right clicking).
image

// Rolf

1 Like

The “Peter’s tools” plug-in has materials that are called “real materials”, because they assign mass properties to the objects based on mass formulas for density of real materials, whereas the default Rhino materials are just for appearance and rendering purposes. :slight_smile:

1 Like

I ended up using this icon. :slight_smile: Works best on a grey background, because the letter W is white. Feel free to use it if you like.
Badass mass 4

1 Like

FWIW, I just posted a new, slightly improved version of the plugin. I added Mass as a command, which just posts the cumulative mass of whatever objects you select to the command line. There are command-line options for rounding and units.

7 Likes

Peter,
Let me be the 1st to say a big thank you for this update.
One request though: In the US jewelry world everything is done in dwt
Could you please add them?
Many jewelers will be very appreciative.
PS: If there was a donate button I for once would sure click it.

Thank you for the effort to provide us with those useful tools, Peter! I especially like the newly added “Mass” command that I missed so much up until now. :slight_smile:

Sure, I added Pennyweights to v2.1.5

1 Like

Hi @phcreates , if I’m not asking too much, would it be possible to make the following upgrades to your script?

  1. You have a “SelectObjectsWithNoRealMaterial” option in the command line when activating the “Real material tools”. Could you add a dedicated icon with the following actions for the left and right mouse buttons:

a) LMB: “SelectObjectsByRealMaterialType” to select individual objects that have a certain type of material (aluminum, steel, glass, nylon, concrete etc) from a list of existing material types in the Command line.
Your “Add dot with data to objects” command already has a Command line option called “RealMaterial” to add dots consisting the type of material to the selected objects. However, this will only mark the objects but will not select only those objects which have an individual type of material.

b) RMB: “SelectObjectsWithRealMaterial” to select all objects with real material.

I made an icon for the above commands if you want to use it: SelectObjectsByRealMaterialType

  1. Calculation of the mass of selected objects via your “Mass” command to work even if one of the objects does not have a real material assigned to it. Currently, if one of the objects does not have a real material, the command returns the following message: “Cannot calculate mass of one or more objects selected. Make sure objects have a real material assigned.” and will not calculate the mass of the rest objects. Is there a way to automatically de-select or mark with dots (like “No material”) all the objects without a real material afterwards, so that we can clearly see which ones are excluded from the calculation? There is already a command line option “SelectObjectsWithNoRealMaterial” for another of your commands - “Real material tools”, so I suppose this could be combined to work within the “Mass” command, too?

  2. A quick BOM that remembers the user-set options (units, selected columns, write to CSV yes/no), so that if this quicker command is used, it will only require to select the objects, press the “Quick BOM” icon and will automatically copy the mass measurements into the clipboard. That would save a few mouse clicks for every time the command is used. If changes are need to use different units or any other different option, the regular BOM could be used instead. If the latter has a “Remember settings” tick box, that could be used as a way to turn off the saved settings for the “Quick BOM”. If those settings are disabled, then the next time “Quick BOM” is being activated it will ask which settings to remember.

  3. An option to apply the material type as an object name to the selected objects. For example, assigning an Aluminum real material to objects would automatically name them “Aluminum”, too.

Wow, that’s a lot of requests…

  1. a) Should be fairly easy and makes sense. Also fwiw, material names are not hidden from you, they are stored as user text (in properties in the attributes user text area) You can access those values yourself.
  2. b) While this is easy, it’s easier to make your own button with this macro:
    RealMaterialTools SelectObjectsWithNoRealMaterial Invert
  3. It’s possible, but I probably won’t do that. Right now it works like the Volume command in Rhino, which just gives you a message if you select objects that aren’t closed. I actually think that it’s very clear the way it is right now. But I do see that there could be utility to that, or maybe just another command to select all open objects. Actually, easy to macro like this if you want to see all open objects in your document:
    selopenmesh selopenpolysrf selopensrf selopensubd
  4. I do plan to reduce the number of menus that pop up, but might not be 100% macro-able (unlike Mass.) We’ll see.
  5. Probably not something that I’ll do, but again you’re welcome to make your own script that accesses the material names. In Rhinoscript, it’s basically like this:
    strObjectMaterialName = Rhino.GetUserText(strObject, “RealMaterial”)

On request #3, after activating the “Mass” command the warning message shows up when one of the objects does not have a real material assigned to it. It’s not about whether it’s closed or opened. :slight_smile: I guess that before using the “Mass” command on the selected objects, I will have to make sure to use “Isolate objects”, then “Real material tools” with the “SelectObjectsWithNoRealMaterial”, then “Invert” and then “Mass”. This way, the warning message should no longer prevent the calculation of the mass of selected objects if one of them don’t have a material by accident.

As for the selection by object value, unfortunately Rhino’s native “Select by user text value” command requires the user to manually write the material in the Command line. It’s also mandatory to write the material starting with a capital letter, i.e. it will not select the objects with assigned real material “Aluminum” if I write “aluminum” in the Command line. :smiley: To select objects with a real material Aluminum in an alternative way, I have to open the Properties panel (I have it closed the majority of the time), then select an object in the scene with the hope that it’s really Aluminum, then navigate through the “Attribute user text” tab and then right-click under the value column and press “Select objects by value”. My point was that if there was a dedicated command for that, it would evoke a text list in the Command line with all the available real materials already assigned to the scene objects, and then pressing one of these names would automatically select any object in the scene of the same material type. :slight_smile: