My drawing template title block has a section for estimated weight. This value and overall size is used to determine shipping methods of our products. This value is pulled from the Type->Physical Properties-Model and Property->MASS. There is no option to turn off units. When our clients look at the drawing, they often get confused with lbmass unit. example; When someone asks what the weight of the product is, we dont say it is 1300 pound mass, we say it is 1300 pounds. I have looked around all different forums and found no complete answer or solution to this.
The only thing closest to a solution that I found on this forum is to create a rule that creates a custom iproperty within the model.(http://forums.autodesk.com/t5/Autodesk-Inventor/Ho
You then have to create a text field in your title block that populates from that custom iproperty but can only be done when a base view is inserted from a model that has the custom iproperty rule applied.
From what I have tried, you can create a .ipt template to save you from creating that rule to create a custom iproperty each and everytime, but to populate the title block field, a user needs to create that text field and draw from that custom iproperty once the base view is set on the drawing.
I also found a way to incorporate mass without units but the information will be put into the parts list. So instead of the weight being "automatically" entered into the title block after inserting base view, I could create a parts list for every drawing. (Not a good solution) http://forums.autodesk.com/autodesk/attachments/au
One last solution that I found, is there used to be a tool called iProperty Collection (http://ipc.barok.dk/) that gave users the ability to customize some Inventor functions. One being the ability to change the unit displayed for MASS. I haven't tried using this tool becasue the last update off the website stated in 2009; says the software is not compatible with Inventor 2009 64bit, since I am using Inventor 2012 64bit, I think this is a dead end.
If anyone has any info or help, please post or reply, you are not just helping me, but the entire Autodesk Community.
Solved! Go to Solution.
I do something similar to the first method you mentioned, except, instead of having an iLogic rule at the part level, I have a rule at the drawing level.
I created a rule in my drawing template that gets the mass of the model document in the view that was placed first. It stores this mass value to a custom iProperty called TotalWT. This TotalWT is displayed in my title block. Here is the code:
doc = ThisDoc.Document
customPropertySet = doc.PropertySets.Item("Inventor User Defined Properties")
'Make sure TotalWT property exists
prop = customPropertySet.Item("TotalWT")
'Assume error means not found
'Find the filename of the model used in the drawing
modeldocname = IO.Path.GetFileName(ThisDoc.ModelDocument.FullFile
'Find the mass of the model used in the drawing
mass = iProperties.Mass(modeldocname)
'Write the mass of the model to the TotalWT custom iProperty.
'The mass is converted from kg to lbs and rounded to the nearest integer
iProperties.Value("Custom", "TotalWT") = Round(mass*2.20462)
The way I have it set up, this rule is completely manual. It is not a real-time measure of mass (it's like a snapshot of the mass at the time the rule is run), so if my model changes I have to remember to update it (by executing the rule again). There are probably ways to make it less manual, but it works for me so I haven't gone any further with it.
Like I said, I just added this rule to my drawing template so that it is available for any new drawing I create. You could also create it as an external rule, so that it is available for any drawing whether it is new or old. Also, the first part of the code detects whether or not the TotalWT iProperty exists. If it does not, it creates it for me. This is useful for running the rule on drawings that were created before I set up my template.
Why don't you just tweak that iLogic rule to write to a user parameter instead of a property? You could then set the user parameter to export to properties, giving you the option to customize the export options and therefore controlling display of the units.
I don't see a way to export a user parameter to a custom iProperty in the drawing environment (which is where this code resides). You would have to do that at the part/assembly level (which is the first method the OP referenced).
Oh, ok. I couldn't tell.
FYI, whichever message you click the reply button, it will say "in reply to" the user who posted that message. ...That was an awkward sentence. See the image for the correct interpretation of what I just said.
Thank you cwhetten! This rule works perfectly, I have applied it to my template this morning and set up a trigger to run the rule after I save the document. I have another rule that runs after a save that applies the scale to the title block as well. Once I get the formatting of the title block completed, I will upload it for others to use.
I have next to zero knowledge when it comes to programming/code, but I noticed that your code generates the weight in Kg then converts to lbs. Would it make sense if I deleted that part of the code, the result would be in kg? I am creating 2 drawing templates, one in standard and one in metric.
Also, your code rounds up to the nearest integer, I suppressed the "Round" command and it then provided a result with like 6 decimal places. Can the command be written to round up to the nearest half pound? example 2345.3999 lbs would be 2345.5 lbs, or .635 lbs would be 0.5 lbs?
Thanks for you help this far.
Thanks to the replies to this post and other posts I have managed to set-up our title block with the required information and requested format.
I am uploading the template file, for others to use or reference to. There is 2 rules one for scale and one for mass. I have adjusted the mass rule to display values to the nearest half pound.
My title block was designed for B sized sheet. Although if we decide to make larger prints in the future, I have created it, so that by changing one dimension ( the 6.000 length one) the whole block scales up or down accordingly. All that is needed to adjust afterwards is the font size (text boxes are constrained to their locations).
Hope this can be used by many,
Thanks again to all the helped me.
Thank You for posting this i have one question. is there a way to get it to jump to the next .1lbs instead of .5lbs?
Thanks in advance...
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.