
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
In an assembly document, I try to add a MateConstraint between male and female side of an 45 degres elbow.
The male side is built on the XZ Plane and Y Axis And I try to create a workplane on the female face.
But a got an error with the last line of code. Here's my code (vb.net code) :
' Get application object
Dim app As Inventor.Application = GetObject(, "Inventor.Application")
Dim doc As Inventor.AssemblyDocument = app.ActiveDocument
' Get the selected occurrence
Dim occ As Inventor.ComponentOccurrence = doc.SelectSet.Item(1)
Dim body As Inventor.SurfaceBody = occ.SurfaceBodies(1)
' Get the face on female side
Dim face As Inventor.Face = body.Faces(58)
Dim params(3), normals(3) As Double
face.Evaluator.GetNormal(params, normals)
Dim vector As Inventor.Vector = app.TransientGeometry.CreateVector(normals(0), normals(1), normals(2))
Dim plane As Inventor.Plane = app.TransientGeometry.CreatePlane(face.PointOnFace, vector)
Dim workplane As Inventor.WorkPlane = doc.ComponentDefinition.WorkPlanes.AddByPlaneAndPoint(plane, face.PointOnFace, True)
Thank for help.
Pascal
Solved! Go to Solution.