查看单个帖子
旧 2009-04-12, 07:37 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】simplify code

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