几何尺寸与公差论坛

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

【转帖】addmate3

[复制链接]
发表于 2009-4-13 08:48:19 | 显示全部楼层 |阅读模式
addmate3
hi,
i am using addmate3 for mating the two components.thogh i am passing "align" for the mate in the model it taking "antialign" .can anybody help with this behaviour of api
post your code sample
here is the sample code for mates
step1: we replace the part selected in gui and select the planes for mating (refer the code below)
swopenfile.replacecomponentwithinstance("668-jacking_pad_end-1@837-grdmt-01", modstrpmreplace2, "-1@837-grdmt-01")
swopenfile.mateconstraints("tank_right", "668_d@" & modstrfinalpath & "@837-grdmt-01", swconst.swmatetype_e.swmatecoincident, swconst.swmatealign_e.swmatealignanti_aligned)
swopenfile.mateconstraints("jacking_pad_end_x1", "668_b@" & modstrfinalpath & "@837-grdmt-01", swconst.swmatetype_e.swmatecoincident, swconst.swmatealign_e.swmatealignanti_aligned)
swopenfile.mateconstraints("jacking_pad_end_y", "668_c1@" & modstrfinalpath & "@837-grdmt-01", swconst.swmatetype_e.swmatecoincident, swconst.swmatealign_e.swmatealignanti_aligned)
step2: goes to function "swopenfile.mateconstraints" :the function works like below
-------------
public sub mateconstraints(byval strplane1 as string, byval strplane2 as string, byval strmate1 as integer, byval strmate2 as integer)
solidworksvariables.bret = solidworksvariables.swmodel.extension.selectbyid2(strplane1, "plane", 0, 0, 0, true, 0, nothing, 0)
solidworksvariables.bret = solidworksvariables.swmodel.extension.selectbyid2(strplane2, "plane", 0, 0, 0, true, 0, nothing, 0)
solidworksvariables.matefeature = solidworksvariables.swassy.addmate3(strmate1, strmate2, false, 0, 0, 0, 1, 1, 0, 0, 0, false, solidworksvariables.mateerror)
solidworksvariables.swassy.editrebuild3()
end sub
-----------------------
i have an issue in with solidworks (for the past few years now) the original sr was:
sr# 1-404705411 using addmate3 to apply angle mates appears to ignore the flip setting passed to it and decide for itself what to do.
which turned into an spr that is still open.
spr# 299322 functionality of flip argument in assemblydoc.addmate3 is inconsistent
you may be up against the same bug. please report it to your var and get an issue in, the more the merrier when it comes to getting things fixed.
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-24 01:46 , Processed in 0.036436 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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