几何尺寸与公差论坛

 找回密码
 注册
查看: 695|回复: 0

【转帖】mass equation

[复制链接]
发表于 2009-4-13 12:46:48 | 显示全部楼层 |阅读模式
mass equation
i have a note in my assembly that reads "
do you mean the note is in your assembly (.sldasm) or assembly drawing (.slddrw)?
-handleman, cswp (the new, easy test)
if you control the custom property in a design table, you have the full slate of excel functions at your disposal to create strings from values.
i am putting the note in my assembly. i them would like to be capable of taking the value from this note and putting it on the drawing either by a current plm defined property or as a seperate note.
situation is what we have are assemblies that are a combination of other assemblies as well as parts and these are welded together. thru years of unscientific research they have determined that the weld material accounts for 4% of the mass.
design tables are best, but first i want to show the process is capable of being done then i can convince the plm guys of a good direction.
thanks
so... would it be ok to link the note in the assembly file to a custom property in that same file?
-handleman, cswp (the new, easy test)
i believe the only way you will be able to calculate some percentage of the weight outside of a design table and custom properties is by using equations.  while design tables are great at what they do, it's way too easy to modify the model without excel doing the calculations that are supposed to change.  most people don't realize that the excel formulas in a design table don't get evaluated unless the design table is edited.
to get the mass of a part in an equation, use:
"mymass"=swapp.getopendocument("s.sldasm").extension.createmassproperty.mass
where "s.sldasm" is the filename of the assembly.  you will probably have to multiply by some scale factor to get the mass in the units you want.  you can then use "mymass" in another equation, such as:
"mypctmass"="mymass"*0.04
getting mypctmass into a note is a little trickier.  you can either link a custom property to mypctmass and then link the note to that property or you can create some sketch entity in the model, dimension that entity, and link the dimension to mypctmass.  you can then add the dimension value to a note by clicking on the dimension while editing the note.
is there any way of putting an equation like this in the part template i use, to get both kg and pounds as a property?  
put the following equation into your part:
"masskg"= part.extension.createmassproperty.mass
this will return the mass in kg, regardless of the document's unit settings.  then you can add the equation:
"masslb"="masskg"*2.2046226
to get the mass in pounds.  add your custom properties, link them to "masskg" and "masslb", then file->save as... and choose "part template" as the type.
for some reason, last time i tried using "part.extension..." in an equation it didn't seem to work, so i used the "getopendocument" method.  "part" is much simpler, and you don't have to put in the exact filename.
-handleman, cswp (the new, easy test)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 09:51 , Processed in 0.035744 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表