几何尺寸与公差论坛

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

【转帖】simplify code

[复制链接]
发表于 2009-4-12 19:37:18 | 显示全部楼层 |阅读模式
simplify code
is there a way to simplify this piece of program code
part.extension.selectbyid2 "drive2-1@kratzer t1", "component", 0, 0, 0, false, 0, nothing, 0
part.compconfigproperties4 2, 0, true, true, strname1, false
i've tried to rewrite it the same as this:
swdoc.parameter("lengte@base-flange1@midden2-1@kratzer <A href="mailto:t2/m2_plate3-1@midden2.part").systemvalue">t2/m2_plate3-1@midden2.part").systemvalue = dbllengte2
i thought it would be something like:
swdoc.compconfigproperties4("drive2-1@kratzer t1.assemby").refconfigname= strname1
but it doesn't work that way.
the hole programcode would be more readable for others if i could write this handling in 1 line in stead of 2.
you're right. it doesn't work that way. please check the api help for the syntax of modeldoc2::compconfigproperties4.
i usually get better results from my code by checking the api help rather than making a wag about how i think it oughtta work.
there's no way i know of to change a component's configuration in a single line of code only knowing the name of the component. it's pretty readable the way it is, by the way.
i'll get you eh steve, if it's the last thing i dooooo!
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-22 23:40 , Processed in 0.034732 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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