1 Reply Latest reply on Aug 23, 2013 10:09 PM by Keith Rice

    Edit sub-assembly mate

    Luc St-Pierre

      I am trying to modify an angle mate from a sub-assembly using IAssemblyDoc::EditMate2. I did everything I found about it in the documentation : Select mate entities, select the mate feature then call EditMate2. However EditMate2 returns 0 (swAddMateError_ErrorUknown) and I can see that the mate was not modified. I tried calling IAssemblyDoc::EditAssembly on the sub-assembly component's assembly document before editing mate and also call EditMate2 on that assembly document but it also did not work. EditAssembly function does not even do anything. I expected it would be the equivalent of selecting the sub-assembly and clicking on "Edit Assembly".


      If I open just the sub-assembly file, EditMate2 works very well.


      What am I doing wrong?

        • Re: Edit sub-assembly mate
          Keith Rice



          1. Have you tried using EditMate2 on a top level mate? I would recommend trying this to see if you are able to get EditMate2 to work at all, this way you can determine if the issue is really related to sub-assemblies or whether it is related to your code. I know it does work. I have used it in the past. For example, see the video at the bottom of this blog post: Mating Automation Techniques.


          2. IAssemblyDoc::EditAssembly is only used to leave in-context assembly editing. For example, you would edit a part in context using IAssemblyDoc::EditPart2, then you would return to the assembly with EditAssembly. So, no, it is not the same as "Edit Assembly" in the user interface. Instead you should it EditPart2.



          Learn SolidWorks API