If I am understanding you correctly: for whatever reason, you already have the transform array data but now you want the plane selected that has that array data? Why not just traverse all reference planes, getting their array data, and then compare that array data to the array data you already have?
Yes, you understand me correctly. But it may have a direct way (like SelectByID), without iterate over all the planes.
IModelDocExtension::SelectByID2 can be unreliable if you don't know the name of the feature. Anyway if that's all you want to do then here's that VBA example modified to reselect the plane afterward based purely on the array data describing translation:
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swSelMgr As SldWorks.SelectionMgr
Dim swFeat As SldWorks.Feature
Dim swRefPlane As SldWorks.RefPlane
Dim swXform As SldWorks.MathTransform
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swSelMgr = swModel.SelectionManager
Set swFeat = swSelMgr.GetSelectedObject5(1)
Set swRefPlane = swFeat.GetSpecificFeature2
Set swXform = swRefPlane.Transform
Debug.Print " Origin = (" & -1# * swXform.ArrayData(9) * 1000# & ", " & -1# * swXform.ArrayData(10) * 1000# & ", " & -1# * swXform.ArrayData(11) * 1000# & ") mm"
Debug.Print " Rot1 = (" & swXform.ArrayData(0) & ", " & swXform.ArrayData(1) & ", " & swXform.ArrayData(2) & ")"
Debug.Print " Rot2 = (" & swXform.ArrayData(3) & ", " & swXform.ArrayData(4) & ", " & swXform.ArrayData(5) & ")"
Debug.Print " Rot3 = (" & swXform.ArrayData(6) & ", " & swXform.ArrayData(7) & ", " & swXform.ArrayData(8) & ")"
Debug.Print " Trans = (" & swXform.ArrayData(9) * 1000# & ", " & swXform.ArrayData(10) * 1000# & ", " & swXform.ArrayData(11) * 1000# & ") mm"
swModel.Extension.SelectByID2 Empty, "PLANE", swXform.ArrayData(9), swXform.ArrayData(10), swXform.ArrayData(11), False, 0, Nothing, 0
But what if the plane is the basic? (front, top, right)
I see. The only different between the three basic planes is rotation, not translation. You can't select something based on its rotation so you can't use IModelDocExtension::SelectByID2 in this scenario. You will have to compare the ArrayData of each basic plane to the ArrayData you already have.
You may also try ModelDoc2::SelectByRay because it gives you the ability to specify the direction. Having your transform you may find the plane normal which will be your direction and the closest point to plane (the point(may be transform translation point) which is moved a bit in direction of normal).
This may produce quite accurate results but I cannot be very confident. This method is never been in the scope of my use - just for testing and learning purposes.
Application Engineer at Intercad
Tel: +61 2 9454 4444