AnsweredAssumed Answered

Editing A Mate In API Help

Question asked by Aj Jones on Sep 6, 2012
Latest reply on Sep 12, 2012 by Aj Jones

First of all I will warn you that I am new to VBA and working with the API.  I've been recording macros and editing them, but I can't seem to get my API to edit a distant mate that already exists. 


So you know, I did search a lot and try a lot of different things with these examples but I still can't get it to work:


Below is my code that I currently have.  I read what all the numbers / TRUE & FALSE stands for in the EditMate2 and SelectByID2 commands, but I'm still not getting this to work.  I just want it to change the distant mate that already exists.  The distant mate is called "DEPTH", and I want to change it to 150 (or whatever I type in).  Thank you in advance


Dim swApp As Object

Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long


Sub main()


Set swApp = _


Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("DEPTH", "MATE", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "FACE", -0.338201, -0.015875, -1.1684, True, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "FACE", 0.354076, -1.58749999999999E-02, -4.4704, True, 1, Nothing, 0)
Part.EditMate2 5, 0, False, 150, 150, 150, 0, 0, 0, 0, 0, longstatus
Part.ClearSelection2 True


End Sub