- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create a work point from 3 work planes that are created in the same sub routine. The 3 work planes are create properly but I get an error when I try to create the work planes.
The following is a snippet from the code. Everything works properly up to "wpNew = oAsmCompDef1.WorkPoints.AddByThreePlanes(oNewWorkPlane1, oNewWorkPlane2, oNewWorkPlane3)"
Also attached is the error message.
Any ideas?
..
'set up the work plane proxys
Dim oWorkPlaneProxy1 As WorkPlaneProxy = Nothing
oEnclosure.CreateGeometryProxy(oAssyPlane1, oWorkPlaneProxy1)
Dim oWorkPlaneProxy2 As WorkPlaneProxy = Nothing
oEnclosure.CreateGeometryProxy(oAssyPlane2, oWorkPlaneProxy2)
Dim oWorkPlaneProxy3 As WorkPlaneProxy = Nothing
oEnclosure.CreateGeometryProxy(oAssyPlane3, oWorkPlaneProxy3)
'these are the new assembly work planes
Dim oNewWorkPlane1 As WorkPlane = Nothing
Dim oNewWorkPlane2 As WorkPlane = Nothing
Dim oNewWorkPlane3 As WorkPlane = Nothing
Call oWorkPlaneProxy1.GetPosition(oOriginPnt, oXaxis, oYaxis)
oNewWorkPlane1 = oAsmCompDef1.WorkPlanes.AddFixed(oOriginPnt, oXaxis, oYaxis)
oNewWorkPlane1.Name = oNewWorkPlaneName1
Call oWorkPlaneProxy2.GetPosition(oOriginPnt, oXaxis, oYaxis)
oNewWorkPlane2 = oAsmCompDef1.WorkPlanes.AddFixed(oOriginPnt, oXaxis, oYaxis)
oNewWorkPlane2.Name = oNewWorkPlaneName2
Call oWorkPlaneProxy3.GetPosition(oOriginPnt, oXaxis, oYaxis)
oNewWorkPlane3 = oAsmCompDef1.WorkPlanes.AddFixed(oOriginPnt, oXaxis, oYaxis)
oNewWorkPlane3.Name = oNewWorkPlaneName3
Dim wpNew As WorkPoint
wpNew = oAsmCompDef1.WorkPoints.AddByThreePlanes(oNewWorkPlane1, oNewWorkPlane2, oNewWorkPlane3)
Solved! Go to Solution.