|
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 |
|