I wrote this one a few months ago becuase I required it.
just paste this into an empty macro
Sub main() 'Written by Corey Scheich 'Creates a plane Parallel with the current view rotation 'through the origin of the part
Dim swApp As SldWorks.SldWorks Dim Model As SldWorks.ModelDoc2 Dim ThisView As SldWorks.ModelView Dim ViewTransform As SldWorks.MathTransform Dim MathUtil As SldWorks.MathUtility Dim Point1 As SldWorks.MathPoint Dim Point2 As SldWorks.MathPoint Dim Point3 As SldWorks.MathPoint Dim dPoint(2) As Double Dim vPoint As Variant Dim NewPlane As SldWorks.refPlane
Set swApp = Application.SldWorks Set Model = swApp.ActiveDoc Set ThisView = Model.ActiveView Set MathUtil = swApp.GetMathUtility
dPoint(0) = 0 dPoint(1) = 0 dPoint(2) = 0
vPoint = dPoint
Set Point1 = MathUtil.CreatePoint((vPoint)) Point1.ArrayData = vPoint dPoint(0) = 1 dPoint(1) = 0 dPoint(2) = 0
vPoint = dPoint
Set Point2 = MathUtil.CreatePoint((vPoint))
dPoint(0) = 0 dPoint(1) = 1 dPoint(2) = 0
vPoint = dPoint
Set Point3 = MathUtil.CreatePoint((vPoint))
Set ViewTransform = ThisView.Orientation3 'change from (model to view) to (view to model) Set ViewTransform = ViewTransform.Inverse
'transform the points from View to Model Set Point1 = Point1.MultiplyTransform(ViewTransform) Set Point2 = Point2.MultiplyTransform(ViewTransform) Set Point3 = Point3.MultiplyTransform(ViewTransform)
'Create a plane through the points Set NewPlane = Model.CreatePlaneFixed2( _ Point1.ArrayData, _ Point2.ArrayData, _ Point3.ArrayData, _ True) Model.UnBlankRefGeom
End Sub