I find the bug of the version -2012,when I use VB ,I can't add the equations by the head of "D2..." or "D3..."
.................
Set swp = CreateObject("SldWorks.Application")
swp.Visible = True
Set swModel = swp.ActiveDoc
Set instance = swModel.GetEquationMgr
a = Split(Text1.Text, vbCrLf)
For i = 0 To UBound(a)
VA = instance.Add2(i + 1, a(i), False)
Text1.text:
"L"= "L1"
"W"= "W1"
"H"= "H1"
"A"= "A1"
"B"= "B1"
"C"= "C1"
"D"= "D1"
"M"= "M1"
"N"= "N1"
"D2@Z1@dituo<1>.Assembly" = "M"
"D1@Z1@dituo<1>.Assembly" = "N"
"D2@S1@dituomianban<1>.Part@dituo<1>.Assembly"= "W"
"D1@S1@dituomianban<1>.Part@dituo<1>.Assembly"= "L"
"D1@L1@dituomianban<1>.Part@dituo<1>.Assembly"= "A"
"D1@Z2@dituo<1>.Assembly" = "N"
"D1@J1@dituo<1>.Assembly"= "B" + "C"
"D1@J2@dituo<1>.Assembly" = "B" + "C"
"D1@S1@dCEBANMIANBAN<1>.Part@dceban<1>.Assembly"= "L" + 2 * ( "B" + "C" )
"D2@S1@dCEBANMIANBAN<1>.Part@dceban<1>.Assembly" = "H" + "A" + "C"
"D1@L1@dCEBANMIANBAN<1>.Part@dceban<1>.Assembly"= "B"
"D1@S1@dCEBANHENGJIN<1>.Part@dceban<1>.Assembly" = "L" + 2 * ( "B" + "C" )
"D2@S1@dCEBANHENGJIN<1>.Part@dceban<1>.Assembly"= "D"
"D1@L1@dCEBANHENGJIN<1>.Part@dceban<1>.Assembly"= "C"
..............................
SolidworksApi macros