几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » SolidWorks二次开发
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-04-13, 12:46 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】mass equation

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)
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】increasing length of part, want pattern instances to match yang686526 SolidWorks二次开发 0 2009-04-13 12:14 PM
【转帖】ifthen equation yang686526 SolidWorks二次开发 0 2009-04-13 12:08 PM
【转帖】equation question yang686526 SolidWorks二次开发 0 2009-04-13 10:43 AM
【转帖】equation for extrusion depth yang686526 SolidWorks二次开发 0 2009-04-13 10:42 AM
【转帖】open the equation manager of a componen yang686526 SolidWorks二次开发 0 2009-04-12 09:57 PM


所有的时间均为北京时间。 现在的时间是 01:46 PM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多