Inventor: Adding WorkAxis by AddByPointAndPlane method

by Vladimir Ananyev

Issue

Are there any examples available showing how to use AddByPointAndPlane? This method is not documented in the help file.

Solution

Method AddByPointAndPlane is obsolete and is not recommended starting from the release Inventor 2008. It was replaced by more powerful AddByNormalToSurface method.

The following VBA example illustrates this method.

 

Sub CreateWorkAxis()

 

  Dim oPart As PartDocument

  Set oPart = ThisApplication _

    .Documents.Add(kPartDocumentObject)

 

  Dim oDef As PartComponentDefinition

  Set oDef = oPart.ComponentDefinition

 

  Dim oTG As TransientGeometry

  Set oTG = ThisApplication.TransientGeometry

 

  Dim oSketch As PlanarSketch

  Set oSketch = oDef.Sketches _

        .Add(oDef.WorkPlanes(1))

 

  Dim oPoint As SketchPoint

  Set oPoint = oSketch.SketchPoints _

        .Add(oTG.CreatePoint2d(2, 2), False)

 

  Dim oAxis As WorkAxis

  Set oAxis = oDef.WorkAxes _

      .AddByNormalToSurface( _

          oDef.WorkPlanes(2), _

          oPoint, False)

 

  This still works but not supported

  Set oAxis = oDef.WorkAxes _

    .AddByPointAndPlane( _

      oPoint, oDef.WorkPlanes(2), False)

End Sub

 

See also this post on work features in Inventor:


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading