RevolvedProtrusions (.add vs .addfinite)

 

I'm trying to make a simple revolved protrusion (360° around an axis).  I can do it with .addfinite, but it leaves a line where the profile is.  I would like to use .add, but there are too many parameters that don't seem to apply, and there are no good examples.  Here is my code so far...

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim oSEApp As SolidEdgeFramework.Application

        Dim oSEDoc As SolidEdgePart.PartDocument

        Dim oProfile(1) As SolidEdgePart.Profile

        Dim oLines As SolidEdgeFrameworkSupport.Lines2d

        Dim oRefPlaneLine As SolidEdgeFrameworkSupport.Line2d

        Dim oAxis As SolidEdgePart.RefAxis

        Const pi = 3.141592

 

        '  get an instance of solid edge.  It will use a running instance first,

        '  and start one if none is present

        Try

            oSEApp = GetObject(, "SolidEdge.application")

        Catch ex As Exception

            oSEApp = Activator.CreateInstance(solidedgeType)

            oSEApp.Caption += "    [Sprocket Wizard Melinium]"

            oSEApp.Interactive = True

            oSEApp.Visible = True

            oSEApp.WindowState = 2

        End Try

        oSEDoc = oSEApp.Documents.Add("SolidEdge.PartDocument", "Normal.par")

        oProfile(0) = oSEDoc.ProfileSets.Add.Profiles.Add(oSEDoc.RefPlanes.Item(2))

        oLines = oProfile(0).Lines2d

        With oLines

            .AddBy2Points(-0.0254, 0.0254, -0.0254, 2 * 0.0254)

            .AddBy2Points(-0.0254, 2 * 0.0254, 0.0254, 2 * 0.0254)

            .AddBy2Points(0.0254, 2 * 0.0254, 0.0254, 0.0254)

            .AddBy2Points(0.0254, 0.0254, -0.0254, 0.0254)

            .AddBy2Points(-0.0254, 0, 0.0254, 0)

        End With

        oAxis = oProfile(0).SetAxisOfRevolution(oLines.Item(5))

        oSEDoc.Models.AddFiniteRevolvedProtrusion(1, oProfile, oAxis, SolidEdgePart.FeaturePropertyConstants.igLeft, 2 * pi)

        oProfile(0).Visible = False

 

 

    End Sub

 

Posted by: Bob Reinkemeyer
Post date: 9/21/2007 4:57:42 AM

2 REPLIES

RE: RevolvedProtrusions (.add vs .addfinite)

 

After hours of deep thought, I've concluded that the precision of "pi" needs to be increased.

It works for me!

 

 

Posted by: Ricky Pursley
Post date: 11/4/2007 10:27:15 AM

RE: RevolvedProtrusions (.add vs .addfinite)

Posted By RyansDad on 11/04/2007 4:27 PM

 

After hours of deep thought, I've concluded that the precision of "pi" needs to be increased.

It works for me!

 

Ding Ding, your correct.  Got the same answer from gtac.  Thanks!

 

 

 

Posted by: Bob Reinkemeyer
Post date: 11/19/2007 10:14:05 AM