Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

3DSketch Wrap To Surface

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
ravikmb5
1511 Views, 19 Replies

3DSketch Wrap To Surface

i am just creating a code for Variable Helix

 

i am not able to see any objects to call in 3Dsketch For Project Surface

i can call Intersection Curves and Silhouette Curves

 

objectModule For 3d Sketch.png 

 

This What i am Trying to do

 

Helix_Def.png

 

 

Helix_Def2.png

 

 

Helix_Def1.png

 

 

i have Created a code up to placing a Constuction Geometry

 

But there i am not able to

project curve surface(Wrap to Surface options) via API

 

 

 

 

Please mark this response as Problem Solved if it answers your question.
----------------------------------------------------------------------------------------------
Ravi Kumar MB,
i7 860 Dell Studio XPS Win 7 64 bit 12 Gb RAM & HP Z220 SFF Workstation
Autodesk Inventor Certified professional 2016
Email: ravikmb5@gmail.com





19 REPLIES 19
Message 2 of 20
ravikmb5
in reply to: ravikmb5

So Far i Was able to do 

 

SyntaxEditor Code Snippet

Sub Main()

' Defining This Document
   Dim oPartDoc As PartDocument
        oPartDoc = ThisApplication.ActiveDocument

'Definining a Component Definition
    Dim oPartDef As PartComponentDefinition
        oPartDef = oPartDoc.ComponentDefinition
                  
    ' Create a 2D sketch on the X-Y plane.
    Dim sketch1 As PlanarSketch
          sketch1 = oPartDef.Sketches.Add(oPartDef.WorkPlanes.Item(3))
    
    'Collecting Transient Geometry
    Dim tg As TransientGeometry
      tg = ThisApplication.TransientGeometry
     
     ' Create's a Projected Centre Point
     Dim oProjectionPoint1 As SketchPoint
         oProjectionPoint1 = sketch1.AddByProjectingEntity(oPartDef.WorkPoints.Item(1))
     
' Converting cm to mm
   Dim tempRadius As Double
   Dim oRadius As Double
   tempRadius = InputBox("Enter The Radius of Helix", "Capricot", "10")
   oRadius = tempRadius/10
   
    ' Create a circle
    Dim oCircle1 As SketchCircle
        oCircle1 = sketch1.SketchCircles.AddByCenterRadius(tg.CreatePoint2d(0, 0),oRadius)
         Call oCircle1.CenterSketchPoint.Merge(oProjectionPoint1)
      
      'Dimensioning a circle
    Dim oDimCircle As DiameterDimConstraint
        oDimCircle = sketch1.DimensionConstraints.AddDiameter(oCircle1, tg.CreatePoint2d(0, (oRadius*2)))
  
       
    
    Dim tempLength As Double
   Dim oLength As Double
   tempLength = InputBox("Enter The Length of Helix", "Capricot", "60")
   oLength = tempLength/10
   
    ' Create a solid extrusion.
    Dim oProfile As Profile
         oProfile = sketch1.Profiles.AddForSolid
    Dim oExtrudeDef1 As ExtrudeDefinition
        oExtrudeDef1 = oPartDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, kNewBodyOperation)
    Call oExtrudeDef1.SetDistanceExtent(oLength, kNegativeExtentDirection)
    Dim oExtrusion1 As ExtrudeFeature
        oExtrusion1 = oPartDef.Features.ExtrudeFeatures.Add(oExtrudeDef1)
                    
   
    ' Get the cylindrical face of the solid.
    Dim oCylinder As Face
        oCylinder = oExtrusion1.SideFaces.Item(1)
    
    ' Creating Workplane
    Dim oWorkPlane As WorkPlane
       oWorkPlane = oPartDef.WorkPlanes.AddByPlaneAndOffset(oPartDef.WorkPlanes(1),oRadius)
       
     ' Creating a Sketch For Construction  
    Dim sketch2 As PlanarSketch
          sketch2 = oPartDef.Sketches.Add(oWorkPlane)
    
    ' Projecting Centre Point
    Dim oProjectionPoint2 As SketchPoint
        oProjectionPoint2 = sketch2.AddByProjectingEntity(oPartDef.WorkPoints.Item(1))
        
    ' Projecting Axis
    Dim oProjectAxis1 As SketchLine
        oProjectAxis1 = sketch2.AddByProjectingEntity(oPartDef.WorkAxes.Item(3))
        oProjectAxis1.Construction = True
       
    ' Projecting End Faces of Cylinder
    Dim oProjectionline1 As SketchEntity
        oProjectionline1 = sketch2.AddByProjectingEntity(oExtrusion1.StartFaces.Item(1).Edges.Item(1))
    Dim oProjectionline2 As SketchLine
        oProjectionline2 = sketch2.AddByProjectingEntity(oExtrusion1.EndFaces.Item(1).Edges.Item(1))
        oProjectionline1.Construction = True
        oProjectionline2.Construction = True
        
    ' Collecting Data From EndUser to Get the Values of Starting Pitch Helix & Ending Pitch Helix
    Dim tempStartPitch As Double
    Dim oStartPitch As Double
    Dim tempEndPitch As Double
       Dim oEndPitch As Double
   tempStartPitch = InputBox("Enter The Starting Pitch of Helix", "Capricot", "10")
   oStartPitch = tempStartPitch/10
   tempEndPitch = InputBox("Enter The Ending Pitch of Helix", "Capricot", "7")
   oEndPitch = tempEndPitch/10
   

    Dim oCon(0 To 5) As CoincidentConstraint
    Dim oConstruct(0 To 5) As SketchLine
    
        ' Creating First Construction Line
        oConstruct1= sketch2.SketchLines.AddByTwoPoints(tg.CreatePoint2d(0, -(oStartPitch)), tg.CreatePoint2d(-(oRadius*2*PI), -(oStartPitch)))
        Call sketch2.GeometricConstraints.AddHorizontal(oConstruct1)
        oConstruct1.Construction = True
        ' Adding Coincident Constraint to Projected Axis and StartSkecth point of First Construction Line
        oCon1 = sketch2.GeometricConstraints.AddCoincident(oProjectAxis1, oConstruct1.StartSketchPoint)
    
    ' Creating Second Construction Line
        oConstruct2= sketch2.SketchLines.AddByTwoPoints(oProjectionPoint2,oConstruct1.EndSketchPoint )
        oConstruct2.Construction = True
        
            ' Creating Third Construction Line
           oConstruct3= sketch2.SketchLines.AddByTwoPoints(oProjectionLine2.StartSketchPoint,tg.CreatePoint2d(-(oRadius*2*PI*10),-(oLength) ))
     Call sketch2.GeometricConstraints.AddHorizontal(oConstruct3)
            oConstruct3.Construction = True
            
            ' Various Points For Placing Dimension
        Dim oTempPoint(0 To 7) As Double
            oTempPoint1 =     (oRadius*2*PI*10)-(oRadius*2*PI)
            oTempPoint2 =     (oRadius*2*PI*10)-((oRadius*2*PI)/2)
            oTempPoint3 =     (OLength+2)
            oTempPoint4 =     oLength-(oEndPitch/2)
            oTempPoint5 =     (oRadius*2*PI*10)-((oRadius*2*PI)+2)
            oTempPoint6    =    ((oRadius*2*PI*10)/2)
            oTempPoint7    =    ((oLength)/2)+ 0.4
            
            ' Creating Fourth Construction Line
            oConstruct4= sketch2.SketchLines.AddByTwoPoints(oConstruct3.EndSketchPoint,tg.CreatePoint2d(-(oTempPoint1),-(oLength-oEndPitch)))
            oConstruct4.Construction = True
            
                    ' Creating FIfth & Last Construction Line
            oConstruct5= sketch2.SketchLines.AddByTwoPoints(oConstruct4.EndSketchPoint,tg.CreatePoint2d(-(oTempPoint1),-(oLength)))
            Call sketch2.GeometricConstraints.AddVertical(oConstruct5)
            oConstruct5.Construction = True
            oCon1 = sketch2.GeometricConstraints.AddCoincident(oConstruct3, oConstruct5.EndSketchPoint)
       
    Dim oDim(0 To 5) As TwoPointDistanceDimConstraint
           oDim1 = sketch2.DimensionConstraints.AddTwoPointDistance _
        (oConstruct1.StartSketchPoint,oConstruct1.EndSketchPoint,DimensionOrientationEnum.kAlignedDim,tg.CreatePoint2d(-(oRadius*2*PI)/2, -(oStartPitch)-0.5))
        oDim2 = sketch2.DimensionConstraints.AddTwoPointDistance _
        (oConstruct2.StartSketchPoint,oConstruct1.StartSketchPoint,DimensionOrientationEnum.kAlignedDim,tg.CreatePoint2d((oRadius*2*PI)/2, (oStartPitch)-0.5))
        oDim3 = sketch2.DimensionConstraints.AddTwoPointDistance _
        (oConstruct3.EndSketchPoint,oConstruct5.EndSketchPoint,DimensionOrientationEnum.kAlignedDim,tg.CreatePoint2d(-oTempPoint2, -oTempPoint3))
        oDim4 = sketch2.DimensionConstraints.AddTwoPointDistance _
        (oConstruct4.EndSketchPoint,oConstruct5.EndSketchPoint,DimensionOrientationEnum.kAlignedDim,tg.CreatePoint2d(-oTempPoint5, -oTempPoint4))
    Call sketch2.solve
        iLogicVb.UpdateWhenDone = True
        
    Dim oProjectArc As    SketchArc
        oProjectArc    =    sketch2.SketchArcs.AddByThreePoints _
        (oConstruct3.EndSketchPoint, tg.CreatePoint2d(-(oTempPoint6), -(oTempPoint7)),oConstruct2.StartSketchPoint)
    Dim oTan(0 To 2) As TangentConstraint 
        oTan1    =    sketch2.GeometricConstraints.AddTangent(oConstruct4,oProjectArc)
        oTan2    =    sketch2.GeometricConstraints.AddTangent(oConstruct2,oProjectArc)
        oWorkPlane.Visible    =    False
        Call sketch2.solve
        iLogicVb.UpdateWhenDone = True
        
    Dim sketch3 As sketch3D
        sketch3 = oPartDef.Sketches3D.Add
End Sub
    
Please mark this response as Problem Solved if it answers your question.
----------------------------------------------------------------------------------------------
Ravi Kumar MB,
i7 860 Dell Studio XPS Win 7 64 bit 12 Gb RAM & HP Z220 SFF Workstation
Autodesk Inventor Certified professional 2016
Email: ravikmb5@gmail.com





Message 3 of 20
ekinsb
in reply to: ravikmb5

Hi Ravi,

 

I'm afraid I have bad news for you.  The equivalent of the "Project to Surface" command is not currently supported by the API so this is not possible to automate.  The API should support it and it would be useful functionality but it currently does not.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 4 of 20
ravikmb5
in reply to: ekinsb

Thanks For ur Response

 

The API should support it and it would be useful functionality but it currently does not.

 

Will it be available in upcoming Release?

 

i have completed this code until here

SyntaxEditor Code Snippet

Sub Main()

' Defining This Document
   Dim oPartDoc As PartDocument
        oPartDoc = ThisApplication.ActiveDocument

'Definining a Component Definition
    Dim oPartDef As PartComponentDefinition
        oPartDef = oPartDoc.ComponentDefinition
    Dim oParams As Parameters
          oParams = oPartDef.Parameters
                   
    ' Create a 2D sketch on the X-Y plane.
        Dim sketch1 As PlanarSketch
            sketch1 = oPartDef.Sketches.Add(oPartDef.WorkPlanes.Item(3))
            sketch1.Name = "Sketch_For_Cylinder_Helix"
    'Collecting Transient Geometry
        Dim tg As TransientGeometry
              tg = ThisApplication.TransientGeometry
     
     ' Create's a Projected Centre Point
         Dim oProjectionPoint1 As SketchPoint
             oProjectionPoint1 = sketch1.AddByProjectingEntity(oPartDef.WorkPoints.Item(1))
     
' Converting cm to mm
           Dim tempRadius As Double
           Dim oRadius As Double
               tempRadius = InputBox("Enter The Radius of Helix", "Capricot", "10")
               oRadius = tempRadius/10
   
    ' Create a circle
    Dim oCircle1 As SketchCircle
        oCircle1 = sketch1.SketchCircles.AddByCenterRadius(tg.CreatePoint2d(0, 0),oRadius)
         Call oCircle1.CenterSketchPoint.Merge(oProjectionPoint1)
      
      'Dimensioning a circle
    Dim oDimCircle As DiameterDimConstraint
        oDimCircle = sketch1.DimensionConstraints.AddDiameter(oCircle1, tg.CreatePoint2d(0, (oRadius*2)))
          oDimCircle.Parameter.Name        =    "Dia_Of_Helix"
        oDimCircle.Parameter.Comment    =    "Diameter of Helix"
       
    
    Dim tempLength As Double
   Dim oLength As Double
   tempLength = InputBox("Enter The Length of Helix", "Capricot", "60")
   oLength = tempLength/10
   
    ' Create a solid extrusion.
    Dim oProfile As Profile
         oProfile = sketch1.Profiles.AddForSolid
    Dim oExtrudeDef1 As ExtrudeDefinition
        oExtrudeDef1 = oPartDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, kNewBodyOperation)
    Call oExtrudeDef1.SetDistanceExtent(oLength, kNegativeExtentDirection)
    Dim oExtrusion1 As ExtrudeFeature
        oExtrusion1 = oPartDef.Features.ExtrudeFeatures.Add(oExtrudeDef1)
        oExtrusion1.Name = "Cylinder_For_Helix_Wound"
    Dim ExtrudeFeatDistExtent As DistanceExtent
        ExtrudeFeatDistExtent =    oExtrusion1.Extent
        ExtrudeFeatDistExtent.Distance.Name         =    "Len_Of_Helix"        
           ExtrudeFeatDistExtent.Distance.Comment         =    "Length of the Entire Helix "
        oExtrusion1.TaperAngle.Name    = "Cylinder_Taper"

        
    ' Get the cylindrical face of the solid.
    Dim oCylinder As Face
        oCylinder = oExtrusion1.SideFaces.Item(1)
    
    ' Creating Workplane
    Dim oWorkPlane As WorkPlane
           oWorkPlane = oPartDef.WorkPlanes.AddByPlaneAndOffset(oPartDef.WorkPlanes(1),(oRadius))
           oWorkPlane.Name    =    "Plane_For_Construct"
        oWorkPlane.Definition.Offset.Name = "Construct_Sketch_Plane"
           oWorkPlane.Definition.Offset.Expression = "=Dia_Of_Helix/2"
        
     ' Creating a Sketch For Construction  
    Dim sketch2 As PlanarSketch
          sketch2 = oPartDef.Sketches.Add(oWorkPlane)
          sketch2.Name = "Construction_Sketch"
    
    ' Projecting Centre Point
    Dim oProjectionPoint2 As SketchPoint
        oProjectionPoint2 = sketch2.AddByProjectingEntity(oPartDef.WorkPoints.Item(1))
        
    ' Projecting Axis
    Dim oProjectAxis1 As SketchLine
        oProjectAxis1 = sketch2.AddByProjectingEntity(oPartDef.WorkAxes.Item(3))
        oProjectAxis1.Construction = True
       
    ' Projecting End Faces of Cylinder
    Dim oProjectionline1 As SketchEntity
        oProjectionline1 = sketch2.AddByProjectingEntity(oExtrusion1.StartFaces.Item(1).Edges.Item(1))
    Dim oProjectionline2 As SketchLine
        oProjectionline2 = sketch2.AddByProjectingEntity(oExtrusion1.EndFaces.Item(1).Edges.Item(1))
        oProjectionline1.Construction = True
        oProjectionline2.Construction = True
        
    ' Collecting Data From EndUser to Get the Values of Starting Pitch Helix & Ending Pitch Helix
    Dim tempStartPitch As Double
    Dim oStartPitch As Double
    Dim tempEndPitch As Double
       Dim oEndPitch As Double
   tempStartPitch = InputBox("Enter The Starting Pitch of Helix", "Capricot", "10")
   oStartPitch = tempStartPitch/10
   tempEndPitch = InputBox("Enter The Ending Pitch of Helix", "Capricot", "7")
   oEndPitch = tempEndPitch/10
   

    Dim oCon(0 To 5) As CoincidentConstraint
    Dim oConstruct(0 To 5) As SketchLine
    
        ' Creating First Construction Line
        oConstruct1= sketch2.SketchLines.AddByTwoPoints(tg.CreatePoint2d(0, -(oStartPitch)), tg.CreatePoint2d(-(oRadius*2*PI), -(oStartPitch)))
        Call sketch2.GeometricConstraints.AddHorizontal(oConstruct1)
        oConstruct1.Construction = True
        ' Adding Coincident Constraint to Projected Axis and StartSkecth point of First Construction Line
        oCon1 = sketch2.GeometricConstraints.AddCoincident(oProjectAxis1, oConstruct1.StartSketchPoint)
    
    ' Creating Second Construction Line
        oConstruct2= sketch2.SketchLines.AddByTwoPoints(oProjectionPoint2,oConstruct1.EndSketchPoint )
        oConstruct2.Construction = True
        
            ' Creating Third Construction Line
           oConstruct3= sketch2.SketchLines.AddByTwoPoints(oProjectionLine2.StartSketchPoint,tg.CreatePoint2d(-(oRadius*2*PI*10),-(oLength) ))
     Call sketch2.GeometricConstraints.AddHorizontal(oConstruct3)
            oConstruct3.Construction = True
            
            ' Various Points For Placing Dimension
        Dim oTempPoint(0 To 7) As Double
            oTempPoint1 =     (oRadius*2*PI*10)-(oRadius*2*PI)
            oTempPoint2 =     (oRadius*2*PI*10)-((oRadius*2*PI)/2)
            oTempPoint3 =     (OLength+2)
            oTempPoint4 =     oLength-(oEndPitch/2)
            oTempPoint5 =     (oRadius*2*PI*10)-((oRadius*2*PI)+2)
            oTempPoint6    =    ((oRadius*2*PI*10)/2)
            oTempPoint7    =    ((oLength)/2)+ 0.4
            
            ' Creating Fourth Construction Line
            oConstruct4= sketch2.SketchLines.AddByTwoPoints(oConstruct3.EndSketchPoint,tg.CreatePoint2d(-(oTempPoint1),-(oLength-oEndPitch)))
            oConstruct4.Construction = True
            
                    ' Creating FIfth & Last Construction Line
            oConstruct5= sketch2.SketchLines.AddByTwoPoints(oConstruct4.EndSketchPoint,tg.CreatePoint2d(-(oTempPoint1),-(oLength)))
            Call sketch2.GeometricConstraints.AddVertical(oConstruct5)
            oConstruct5.Construction = True
            oCon1 = sketch2.GeometricConstraints.AddCoincident(oConstruct3, oConstruct5.EndSketchPoint)
       
    Dim oDim(0 To 5) As TwoPointDistanceDimConstraint
           oDim1 = sketch2.DimensionConstraints.AddTwoPointDistance _
        (oConstruct1.StartSketchPoint,oConstruct1.EndSketchPoint,DimensionOrientationEnum.kAlignedDim,tg.CreatePoint2d(-(oRadius*2*PI)/2, -(oStartPitch)-0.5))
        oDim1.Parameter.Name    =    "Dia_X_PI"
        oDim1.Parameter.Comment    =    "Perimeter of Dia oF Helix Defined for Start Pitch of Helix"
        
        oDim2 = sketch2.DimensionConstraints.AddTwoPointDistance _
        (oConstruct2.StartSketchPoint,oConstruct1.StartSketchPoint,DimensionOrientationEnum.kAlignedDim,tg.CreatePoint2d((oRadius*2*PI)/2, (oStartPitch)-0.5))
        oDim2.Parameter.Name    =    "Startpitch_Of_Helix"
        oDim2.Parameter.Comment    =    "User Specifies a Starting Pitch of Helix"
        
        oDim3 = sketch2.DimensionConstraints.AddTwoPointDistance _
        (oConstruct3.EndSketchPoint,oConstruct5.EndSketchPoint,DimensionOrientationEnum.kAlignedDim,tg.CreatePoint2d(-oTempPoint2, -oTempPoint3))
        oDim3.Parameter.Name        =    "Dia_X_PI_1"
        oDim3.Parameter.Expression    =    "Dia_X_PI"
        oDim3.Parameter.Comment        =    "Perimeter of Dia oF Helix Defined for End Pitch of Helix"
        
        oDim4 = sketch2.DimensionConstraints.AddTwoPointDistance _
        (oConstruct4.EndSketchPoint,oConstruct5.EndSketchPoint,DimensionOrientationEnum.kAlignedDim,tg.CreatePoint2d(-oTempPoint5, -oTempPoint4))
        oDim4.Parameter.Name    =    "Endpitch_Of_Helix"
        oDim2.Parameter.Comment    =    "User Specifies a Endinging Pitch of Helix"
    Call sketch2.solve
        iLogicVb.UpdateWhenDone = True
        
    Dim oProjectArc As    SketchArc
        oProjectArc    =    sketch2.SketchArcs.AddByThreePoints _
        (oConstruct3.EndSketchPoint, tg.CreatePoint2d(-(oTempPoint6), -(oTempPoint7)),oConstruct2.StartSketchPoint)
    Dim oTan(0 To 2) As TangentConstraint 
        oTan1    =    sketch2.GeometricConstraints.AddTangent(oConstruct4,oProjectArc)
        oTan2    =    sketch2.GeometricConstraints.AddTangent(oConstruct2,oProjectArc)
        oWorkPlane.Visible    =    False
        Call sketch2.solve
        iLogicVb.UpdateWhenDone = True
        
    Dim sketch3 As sketch3D
        sketch3 = oPartDef.Sketches3D.Add
End Sub
    

 

 

i have also tried by an Equation Curves3D

but even its not working for some reason 

 

VBA Example which is povided in APi examples is not working For me

 

But Even then it is very difficult to control StartPitch  and End Pitch of Helix

 here is the VBA Example

 

 

 

 

 

 

 

 

Please mark this response as Problem Solved if it answers your question.
----------------------------------------------------------------------------------------------
Ravi Kumar MB,
i7 860 Dell Studio XPS Win 7 64 bit 12 Gb RAM & HP Z220 SFF Workstation
Autodesk Inventor Certified professional 2016
Email: ravikmb5@gmail.com





Message 5 of 20
ekinsb
in reply to: ravikmb5

I'm not able to comment on future functionality but to better the chances of this making it into a future release it's best to make your wishes known by using the Inventor IdeaStation. This way, those that decide where to spend the resources each release will know of your needs.

 

Regarding your code, there seems to be a lot of problems in the code itself.  I'm assuming it's VB.Net code because there aren't any Set statements when you're making assignments.  You declare arrays

 

  Dim oConstruct(0 to 5) as SketchLine

 

but then try to use them like this:

 

  oConstruct1 = ...

 

It should be

 

  oConstruct(1) = ...

 

If it is a VB.Net program, ThisApplication doesn't exist.  Also pi isn't defined anywhere.  If it is a VB.Net program you can use Math.PI.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 6 of 20
ravikmb5
in reply to: ekinsb

Its Not Vb.net code

 

i am Straight away using in Ilogic

 

Any Programmes First i will try to run in VBA or Ilogic

Later on i ask My Engineers to Convert it to an addin

 

i Dont have Much Experience in Vb.net

 

Please mark this response as Problem Solved if it answers your question.
----------------------------------------------------------------------------------------------
Ravi Kumar MB,
i7 860 Dell Studio XPS Win 7 64 bit 12 Gb RAM & HP Z220 SFF Workstation
Autodesk Inventor Certified professional 2016
Email: ravikmb5@gmail.com





Message 7 of 20
ekinsb
in reply to: ravikmb5

Actually you do have experience in VB.Net because that's what iLogic is using.  I think you would find it much easier to do your initial development in VB.Net rather than iLogic because then you'll immediately see all of the errors and be able to use the very good debugging capabilities of Visual Studio.  VBA is also a good tool for initial prototyping.  iLogic would be my last choice because of the editor and lack of debugging.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 8 of 20
ravikmb5
in reply to: ekinsb

iLogic is Betterway For My company Needs

Bec EndUser Can alter Rule For His needs Later

 

VB.Net could be Better

But My Boss does'nt allow me to work in VB.Net

 

He ask some other Engineers to develop addins

Those Engineers Rarely Use Inventor

 

 

 

Please mark this response as Problem Solved if it answers your question.
----------------------------------------------------------------------------------------------
Ravi Kumar MB,
i7 860 Dell Studio XPS Win 7 64 bit 12 Gb RAM & HP Z220 SFF Workstation
Autodesk Inventor Certified professional 2016
Email: ravikmb5@gmail.com





Message 9 of 20
ravikmb5
in reply to: ekinsb

Variable Helix

Creating Helix with the use of 3D Equation Curve (SketchEquationCurves3D)

This feature is not a Parameteric Feature

 

Example

radius = 3 or 3*t

num_turns = 5

height = 10

pitch = 2 or 2*t

t ranges from 0 to 1.

 

  1. constant radius, constant pitch:

 

Cylindrical coordinates:

r(t) = 3

theta(t) = 360*5*t

z(t) = 5*2*t

 

  1. constant radius, variable pitch:

 

Cylindrical coordinates:

r(t) = 3

theta(t) = 360*5*t

z(t) = 5*2*t*t

 

  1. variable radius, constant pitch:

 

Cylindrical coordinates:

r(t) = 3*t

theta(t) = 360*5*t

z(t) = 5*2*t

 

  1. variable radius, variable pitch:

 

Cylindrical coordinates:

r(t) = 3*t

theta(t) = 360*5*t

z(t) = 5*2*t*t

 

Radius 3 mm Should be available in Fx parameter for Future editing

But it Doesn't Why?

 

i have Created a iLogic Rule

it creates a user Parameter Type_Of_Helix withmultivalue List

  1. constant radius, constant pitch:
  2. constant radius, variable pitch:
  3. variable radius, constant pitch:
  4. variable radius, variable pitch:

 

 

Where user selects a Type of helix on Input List Box

then the helix will Creates via Api

 

here is the ILogic Rule ,Part and Video

 

And one More Question How do i constraint These Curves after Creation

 

 

 

Spoiler
Imports Inventor.UnitsTypeEnum

Sub Main()

Dim oParams As Parameters
oParams=ThisApplication.ActiveDocument.ComponentDefinition.Parameters

Dim oUserParams As UserParameters
oUserParams=oParams.UserParameters

Dim oDRAWN As Parameter
Try
otester = oUserParams.Item("Type_OF_Helix")
Catch
oInsulationType=oUserParams.AddByValue("Type_OF_Helix", "Const_Radius_&_Const_Pitch", kTextUnits)
MultiValue.SetList("Type_OF_Helix","Const_Radius_&_Const_Pitch","Const_Radius_&_Vari_Pitch", "Vari_Radius_&_Const_Pitch", "Vari_Radius_&_Vari_Pitch")
End Try

Type_OF_Helix = InputListBox("Select the Type Of Helix you Wish To Create", MultiValue.List("Type_OF_Helix"), Type_OF_Helix, Title := "Capricot", ListName := "Select_Pitch")
If Type_OF_Helix = "Const_Radius_&_Const_Pitch" Then
Const_Radius_And_Const_Pitch
ElseIf Type_OF_Helix = "Const_Radius_&_Vari_Pitch" Then
Const_Radius_And_Vari_Pitch
ElseIf Type_OF_Helix = "Vari_Radius_&_Const_Pitch" Then
Vari_Radius_And_Const_Pitch
ElseIf Type_OF_Helix = "Vari_Radius_&_Vari_Pitch" Then
Vari_Radius_And_Vari_Pitch
End If
End Sub

Sub Const_Radius_And_Const_Pitch()
kCartesian = 98561
kCylindrical = 98563

Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = oPartDoc.ComponentDefinition
'Creating a 3D Sketch
Dim oSketch1 As sketch3D
oSketch1 = oCompDef.Sketches3D.Add

Dim equationCurve2 As SketchEquationCurve3D
equationCurve2 = oSketch1.SketchEquationCurves3D.Add(kCylindrical, _
"3", "360*5*t", "5*2*t", 0, 1)
ThisApplication.ActiveView.Fit

End Sub

Sub Const_Radius_And_Vari_Pitch()
kCartesian = 98561
kCylindrical = 98563

Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = oPartDoc.ComponentDefinition
'Creating a 3D Sketch
Dim oSketch1 As sketch3D
oSketch1 = oCompDef.Sketches3D.Add

Dim equationCurve2 As SketchEquationCurve3D
equationCurve2 = oSketch1.SketchEquationCurves3D.Add(kCylindrical, _
"3", "360*5*t", "5*2*t*t", 0, 1)
ThisApplication.ActiveView.Fit

End Sub

Sub Vari_Radius_And_Const_Pitch()
kCartesian = 98561
kCylindrical = 98563

Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = oPartDoc.ComponentDefinition
'Creating a 3D Sketch
Dim oSketch1 As sketch3D
oSketch1 = oCompDef.Sketches3D.Add

Dim equationCurve2 As SketchEquationCurve3D
equationCurve2 = oSketch1.SketchEquationCurves3D.Add(kCylindrical, _
"3*t", "360*5*t", "5*2*t", 0, 1)
ThisApplication.ActiveView.Fit

End Sub

Sub Vari_Radius_And_Vari_Pitch()
kCartesian = 98561
kCylindrical = 98563

Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = oPartDoc.ComponentDefinition
'Creating a 3D Sketch
Dim oSketch1 As sketch3D
oSketch1 = oCompDef.Sketches3D.Add

Dim equationCurve2 As SketchEquationCurve3D
equationCurve2 = oSketch1.SketchEquationCurves3D.Add(kCylindrical, _
"3*t", "360*5*t", "5*2*t*t", 0, 1)
ThisApplication.ActiveView.Fit

End Sub

 

 

 

 

 

 

 

 

 

 

Please mark this response as Problem Solved if it answers your question.
----------------------------------------------------------------------------------------------
Ravi Kumar MB,
i7 860 Dell Studio XPS Win 7 64 bit 12 Gb RAM & HP Z220 SFF Workstation
Autodesk Inventor Certified professional 2016
Email: ravikmb5@gmail.com





Message 10 of 20
ravikmb5
in reply to: ravikmb5

The original Link

Method of Creating Helix with 3D EQuation Curve Command

 

http://forums.autodesk.com/t5/inventor-general-discussion/variable-pitch-helix-by-equation-curve/td-...

Please mark this response as Problem Solved if it answers your question.
----------------------------------------------------------------------------------------------
Ravi Kumar MB,
i7 860 Dell Studio XPS Win 7 64 bit 12 Gb RAM & HP Z220 SFF Workstation
Autodesk Inventor Certified professional 2016
Email: ravikmb5@gmail.com





Message 11 of 20
ekinsb
in reply to: ravikmb5

Equation driven curves don't create parameters for their inputs except for tMin and tMax.  However you can still accomplish what you want by creating your own parameter and then referencing it in the curve equation.  For example, you can create a parameter called "Radius" and then use it when defining r(t) you can use "Radius" instead of "3".  Changing the value of Radius will cause the curve to recompute.  You can use existing parameter names for any of the curve inputs.

 

About your question about constraining the curve, you don't constrain equation driven curves because they're already fully defined by the equation.  You can however connect other standard sketch curves to these curves using constraints. 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 12 of 20
ravikmb5
in reply to: ravikmb5

No we cannot assign the parameters in r(t)
I have checked it

Anyway
Thanks brain
Please mark this response as Problem Solved if it answers your question.
----------------------------------------------------------------------------------------------
Ravi Kumar MB,
i7 860 Dell Studio XPS Win 7 64 bit 12 Gb RAM & HP Z220 SFF Workstation
Autodesk Inventor Certified professional 2016
Email: ravikmb5@gmail.com





Message 13 of 20
ekinsb
in reply to: ravikmb5

Here's a version of your program that does just that.

 

Sub Main()
    Dim partDoc As PartDocument = ThisApplication.ActiveDocument
    Dim oParams As Parameters
    oParams = partDoc.ComponentDefinition.Parameters

    Dim oUserParams As UserParameters
    oUserParams = oParams.UserParameters

    ' Check to see if "Radius" exists and create it if it doesn't.
    Try
        Dim radParam As UserParameter = oUserParams.Item("Radius")
    Catch ex As Exception
        oUserParams.AddByExpression("Radius", "3", _
                Inventor.UnitsTypeEnum.kDefaultDisplayLengthUnits)
    End Try

    Const_Radius_And_Const_Pitch(partDoc.ComponentDefinition)
    Const_Radius_And_Vari_Pitch(partDoc.ComponentDefinition)
    Vari_Radius_And_Const_Pitch(partDoc.ComponentDefinition)
    Vari_Radius_And_Vari_Pitch(partDoc.ComponentDefinition)
End Sub

Sub Const_Radius_And_Const_Pitch(partDef As PartComponentDefinition)
    'Creating a 3D Sketch
    Dim oSketch1 As Sketch3D
    oSketch1 = partDef.Sketches3D.Add

    Dim equationCurve2 As SketchEquationCurve3D
    equationCurve2 = oSketch1.SketchEquationCurves3D.Add( _
        CoordinateSystemTypeEnum.kCylindrical, _
        "Radius", "360*5*t", "5*2*t", 0, 1)
    ThisApplication.ActiveView.Fit()
End Sub

Sub Const_Radius_And_Vari_Pitch(partDef As PartComponentDefinition)
    'Creating a 3D Sketch
    Dim oSketch1 As Sketch3D
    oSketch1 = partDef.Sketches3D.Add

    Dim equationCurve2 As SketchEquationCurve3D
    equationCurve2 = oSketch1.SketchEquationCurves3D.Add( _
        CoordinateSystemTypeEnum.kCylindrical, _
        "Radius", "360*5*t", "5*2*t*t", 0, 1)
    ThisApplication.ActiveView.Fit()
End Sub

Sub Vari_Radius_And_Const_Pitch(partDef As PartComponentDefinition)
    'Creating a 3D Sketch
    Dim oSketch1 As Sketch3D
    oSketch1 = partDef.Sketches3D.Add

    Dim equationCurve2 As SketchEquationCurve3D
    equationCurve2 = oSketch1.SketchEquationCurves3D.Add( _
        CoordinateSystemTypeEnum.kCylindrical, _
        "Radius*t", "360*5*t", "5*2*t", 0, 1)
    ThisApplication.ActiveView.Fit()
End Sub

Sub Vari_Radius_And_Vari_Pitch(partDef As PartComponentDefinition)
    'Creating a 3D Sketch
    Dim oSketch1 As Sketch3D
    oSketch1 = partDef.Sketches3D.Add

    Dim equationCurve2 As SketchEquationCurve3D
    equationCurve2 = oSketch1.SketchEquationCurves3D.Add( _
        CoordinateSystemTypeEnum.kCylindrical, _
        "Radius*t", "360*5*t", "5*2*t*t", 0, 1)
    ThisApplication.ActiveView.Fit()
End Sub

 

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 14 of 20
ravikmb5
in reply to: ravikmb5

GREAT
THANK YOU VERY MUCH BRAIN
BUT ONE FINAL Question


I should allow user to input
RADIUS
NO OF TURNS
HEIGHT

By ilogic input box

Is any way I can do

Please mark this response as Problem Solved if it answers your question.
----------------------------------------------------------------------------------------------
Ravi Kumar MB,
i7 860 Dell Studio XPS Win 7 64 bit 12 Gb RAM & HP Z220 SFF Workstation
Autodesk Inventor Certified professional 2016
Email: ravikmb5@gmail.com





Message 15 of 20
ekinsb
in reply to: ravikmb5

I've never used an iLogic input box but I assume you can get the values the user has entered.  Then you will need to create parameters using those values and you can use the names of those parameters when defining the equations for the curve.  The biggest issue will be creating unique names for your parameters.  For example, if they run your program twice and you want the radius (and other values) of each helix to be driven independently of the other you'll need to have unique parameters for each helix, i.e. Radius1, Radius2, etc. 

 

There isn't anything built into the API to create unique names.  There are a couple of approaches to solve this.  The first is to do something similar to what I did in the previous sample where it's checking to see if the parameter "Radius" exists and you go into a loop checking if a name is used and once it's not then you know that name is available. 

 

The other option is more elegent but more work.  You could create an attribute in the document with the current count.  Each time you need to create a helix you use that count to append to the parameter name and increment the count.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 16 of 20
ravikmb5
in reply to: ekinsb

Finally i have Finished This Code

Thanks Brain

 

Then

it asks user to input

Radius

No of rev

height

Pitch will be calculated =(Height/No of revoultions)

 

First

user has to select one out of Four choices

  1. constant radius, constant pitch:
  2. constant radius, variable pitch:
  3. variable radius, constant pitch:
  4. variable radius, variable pitch:

Then it Creates a helix

Then

it asks user to input

Radius

No of rev

height

Pitch will be calculated =(Height/No of revoultions)

 

User Parameter are Created With Radius,height,No Of Turns and Pitch

For Future Editing

 

Then Creates an Helix

 

here is the Code

Spoiler
Sub Main()
Type_OF_Helix = "Const_Radius_&_Const_Pitch"' deleted parameter


Dim partDoc As PartDocument = ThisApplication.ActiveDocument
Dim oParams As Parameters
oParams = partDoc.ComponentDefinition.Parameters

Dim oUserParams As UserParameters
oUserParams = oParams.UserParameters

' Check to see if "Radius" exists and create it if it doesn't.

Try
Dim HelixParam As UserParameter = oUserParams.Item("Type_OF_Helix")
Catch ex As Exception

oUserParams.AddByValue("Type_OF_Helix", "Const_Radius_&_Const_Pitch", _
Inventor.UnitsTypeEnum.kTextUnits)
MultiValue.SetList("Type_OF_Helix","Const_Radius_&_Const_Pitch", _
"Const_Radius_&_Vari_Pitch", "Vari_Radius_&_Const_Pitch", "Vari_Radius_&_Vari_Pitch")
End Try



Type_OF_Helix = InputListBox("Select the Type Of Helix you Wish To Create", _
MultiValue.List("Type_OF_Helix"), Type_OF_Helix, Title := "Capricot", ListName := "Select_Pitch")
If Type_OF_Helix = "Const_Radius_&_Const_Pitch" Then
Const_Radius_And_Const_Pitch
ElseIf Type_OF_Helix = "Const_Radius_&_Vari_Pitch" Then
Const_Radius_And_Vari_Pitch
ElseIf Type_OF_Helix = "Vari_Radius_&_Const_Pitch" Then
Vari_Radius_And_Const_Pitch
ElseIf Type_OF_Helix = "Vari_Radius_&_Vari_Pitch" Then
Vari_Radius_And_Vari_Pitch
End If
' iLogicForm.ShowGlobal("Helix")
InventorVb.DocumentUpdate()


End Sub

Sub Const_Radius_And_Const_Pitch()

Dim partDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = partDoc.ComponentDefinition
Dim oParams As Parameters
oParams = partDoc.ComponentDefinition.Parameters

Dim oUserParams As UserParameters
oUserParams = oParams.UserParameters

' Check to see if "Radius" exists and create it if it doesn't.
Try
Dim radParam As UserParameter = oUserParams.Item("Radius")
Catch ex1 As Exception
Try
Dim TurnsParam As UserParameter = oUserParams.Item("No_Of_Turns")
Catch ex2 As Exception
Try
Dim HeightParam As UserParameter = oUserParams.Item("Height_Of_Helix")
Catch ex3 As Exception
Try
Dim PitchParam As UserParameter = oUserParams.Item("Pitch_Of_Helix")
Catch ex4 As Exception
Dim Radius1 As Double
Dim No_Of_Turns1 As Double
Dim Height1 As Double
Dim Pitch1 As Double

Radius1 = InputBox("Radius", "Enter the Radius Of Helix", "3")
No_Of_Turns1 = InputBox("Turns", "Enter The No_Of_Revoultions", "5")
Height1 = InputBox("Height", "Enter The Height Of Helix", "10")

oUserParams.AddByExpression("Radius", Radius1, _
Inventor.UnitsTypeEnum.kDefaultDisplayLengthUnits)
oUserParams.AddByExpression("No_Of_Turns", No_Of_Turns1, _
Inventor.UnitsTypeEnum.kUnitlessUnits)
oUserParams.AddByExpression("Height_Of_Helix", Height1, _
Inventor.UnitsTypeEnum.kUnitlessUnits)
Pitch1 = Height1/No_Of_Turns1
oUserParams.AddByExpression("Pitch_Of_Helix","=Height_Of_Helix/No_Of_Turns", _
Inventor.UnitsTypeEnum.kUnitlessUnits)
End Try
End Try
End Try
End Try
'Creating a 3D Sketch
Dim oSketch1 As Sketch3D
oSketch1 = oCompDef.Sketches3D.Add

Dim equationCurve2 As SketchEquationCurve3D
equationCurve2 = oSketch1.SketchEquationCurves3D.Add( _
CoordinateSystemTypeEnum.kCylindrical, _
"Radius", "360*No_Of_Turns*t", "No_Of_Turns*Pitch_Of_Helix*t", 0, 1)
Call oSketch1.Solve
InventorVb.DocumentUpdate()
ThisApplication.ActiveView.Fit()
End Sub

Sub Const_Radius_And_Vari_Pitch()

Dim partDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = partDoc.ComponentDefinition
Dim oParams As Parameters
oParams = partDoc.ComponentDefinition.Parameters

Dim oUserParams As UserParameters
oUserParams = oParams.UserParameters

' Check to see if "Radius" exists and create it if it doesn't.
Try
Dim radParam As UserParameter = oUserParams.Item("Radius")
Catch ex1 As Exception
Try
Dim TurnsParam As UserParameter = oUserParams.Item("No_Of_Turns")
Catch ex2 As Exception
Try
Dim HeightParam As UserParameter = oUserParams.Item("Height_Of_Helix")
Catch ex3 As Exception
Try
Dim PitchParam As UserParameter = oUserParams.Item("Pitch_Of_Helix")
Catch ex4 As Exception
Dim Radius1 As Double
Dim No_Of_Turns1 As Double
Dim Height1 As Double
Dim Pitch1 As Double

Radius1 = InputBox("Radius", "Enter the Radius Of Helix", "3")
No_Of_Turns1 = InputBox("Turns", "Enter The No_Of_Revoultions", "5")
Height1 = InputBox("Height", "Enter The Height Of Helix", "10")

oUserParams.AddByExpression("Radius", Radius1, _
Inventor.UnitsTypeEnum.kDefaultDisplayLengthUnits)
oUserParams.AddByExpression("No_Of_Turns", No_Of_Turns1, _
Inventor.UnitsTypeEnum.kUnitlessUnits)
oUserParams.AddByExpression("Height_Of_Helix", Height1, _
Inventor.UnitsTypeEnum.kUnitlessUnits)
Pitch1 = Height1/No_Of_Turns1
oUserParams.AddByExpression("Pitch_Of_Helix","=Height_Of_Helix/No_Of_Turns", _
Inventor.UnitsTypeEnum.kUnitlessUnits)
End Try
End Try
End Try
End Try
'Creating a 3D Sketch
Dim oSketch1 As Sketch3D
oSketch1 = oCompDef.Sketches3D.Add

Dim equationCurve2 As SketchEquationCurve3D
equationCurve2 = oSketch1.SketchEquationCurves3D.Add( _
CoordinateSystemTypeEnum.kCylindrical, _
"Radius", "360*No_Of_Turns*t", "No_Of_Turns*Pitch_Of_Helix*t*t", 0, 1)
Call oSketch1.Solve
InventorVb.DocumentUpdate()
ThisApplication.ActiveView.Fit()

End Sub

Sub Vari_Radius_And_Const_Pitch()
Dim partDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = partDoc.ComponentDefinition
Dim oParams As Parameters
oParams = partDoc.ComponentDefinition.Parameters

Dim oUserParams As UserParameters
oUserParams = oParams.UserParameters

' Check to see if "Radius" exists and create it if it doesn't.
Try
Dim radParam As UserParameter = oUserParams.Item("Radius")
Catch ex1 As Exception
Try
Dim TurnsParam As UserParameter = oUserParams.Item("No_Of_Turns")
Catch ex2 As Exception
Try
Dim HeightParam As UserParameter = oUserParams.Item("Height_Of_Helix")
Catch ex3 As Exception
Try
Dim PitchParam As UserParameter = oUserParams.Item("Pitch_Of_Helix")
Catch ex4 As Exception
Dim Radius1 As Double
Dim No_Of_Turns1 As Double
Dim Height1 As Double
Dim Pitch1 As Double

Radius1 = InputBox("Radius", "Enter the Radius Of Helix", "3")
No_Of_Turns1 = InputBox("Turns", "Enter The No_Of_Revoultions", "5")
Height1 = InputBox("Height", "Enter The Height Of Helix", "10")

oUserParams.AddByExpression("Radius", Radius1, _
Inventor.UnitsTypeEnum.kDefaultDisplayLengthUnits)
oUserParams.AddByExpression("No_Of_Turns", No_Of_Turns1, _
Inventor.UnitsTypeEnum.kUnitlessUnits)
oUserParams.AddByExpression("Height_Of_Helix", Height1, _
Inventor.UnitsTypeEnum.kUnitlessUnits)
Pitch1 = Height1/No_Of_Turns1
oUserParams.AddByExpression("Pitch_Of_Helix","=Height_Of_Helix/No_Of_Turns", _
Inventor.UnitsTypeEnum.kUnitlessUnits)
End Try
End Try
End Try
End Try
'Creating a 3D Sketch
Dim oSketch1 As Sketch3D
oSketch1 = oCompDef.Sketches3D.Add

Dim equationCurve2 As SketchEquationCurve3D
equationCurve2 = oSketch1.SketchEquationCurves3D.Add( _
CoordinateSystemTypeEnum.kCylindrical, _
"Radius*t", "360*No_Of_Turns*t", "No_Of_Turns*Pitch_Of_Helix*t", 0, 1)
Call oSketch1.Solve
InventorVb.DocumentUpdate()
ThisApplication.ActiveView.Fit()
End Sub

Sub Vari_Radius_And_Vari_Pitch()

Dim partDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = partDoc.ComponentDefinition
Dim oParams As Parameters
oParams = partDoc.ComponentDefinition.Parameters

Dim oUserParams As UserParameters
oUserParams = oParams.UserParameters

' Check to see if "Radius" exists and create it if it doesn't.
Try
Dim radParam As UserParameter = oUserParams.Item("Radius")
Catch ex1 As Exception
Try
Dim TurnsParam As UserParameter = oUserParams.Item("No_Of_Turns")
Catch ex2 As Exception
Try
Dim HeightParam As UserParameter = oUserParams.Item("Height_Of_Helix")
Catch ex3 As Exception
Try
Dim PitchParam As UserParameter = oUserParams.Item("Pitch_Of_Helix")
Catch ex4 As Exception
Dim Radius1 As Double
Dim No_Of_Turns1 As Double
Dim Height1 As Double
Dim Pitch1 As Double

Radius1 = InputBox("Radius", "Enter the Radius Of Helix", "3")
No_Of_Turns1 = InputBox("Turns", "Enter The No_Of_Revoultions", "5")
Height1 = InputBox("Height", "Enter The Height Of Helix", "10")

oUserParams.AddByExpression("Radius", Radius1, _
Inventor.UnitsTypeEnum.kDefaultDisplayLengthUnits)
oUserParams.AddByExpression("No_Of_Turns", No_Of_Turns1, _
Inventor.UnitsTypeEnum.kUnitlessUnits)
oUserParams.AddByExpression("Height_Of_Helix", Height1, _
Inventor.UnitsTypeEnum.kUnitlessUnits)
Pitch1 = Height1/No_Of_Turns1
oUserParams.AddByExpression("Pitch_Of_Helix","=Height_Of_Helix/No_Of_Turns", _
Inventor.UnitsTypeEnum.kUnitlessUnits)
End Try
End Try
End Try
End Try
'Creating a 3D Sketch
Dim oSketch1 As Sketch3D
oSketch1 = oCompDef.Sketches3D.Add

Dim equationCurve2 As SketchEquationCurve3D
equationCurve2 = oSketch1.SketchEquationCurves3D.Add( _
CoordinateSystemTypeEnum.kCylindrical, _
"Radius*t", "360*No_Of_Turns*t", "No_Of_Turns*Pitch_Of_Helix*t*t", 0, 1)
Call oSketch1.Solve
InventorVb.DocumentUpdate()
ThisApplication.ActiveView.Fit()

End Sub

 

 

 

 https://www.dropbox.com/s/dmdniicpotdgnpf/Untitled.gif?dl=0

 

 

 

 

Please mark this response as Problem Solved if it answers your question.
----------------------------------------------------------------------------------------------
Ravi Kumar MB,
i7 860 Dell Studio XPS Win 7 64 bit 12 Gb RAM & HP Z220 SFF Workstation
Autodesk Inventor Certified professional 2016
Email: ravikmb5@gmail.com





Message 17 of 20
adam.nagy
in reply to: ravikmb5

Hi,

 

Are you all set then? 🙂

Can you mark it somewhere as solved?

 

Thank you,



Adam Nagy
Autodesk Platform Services
Message 18 of 20
AlexFielder
in reply to: adam.nagy

Hi @adam.nagy@ekinsb

 

I thought I would reply here and ask the same question in case my earlier tweet gets lost in the ether or anyone else wants to know; have there been any additions to the API on this subject?

 

Thanks,

 

Alex.

 

 

Message 19 of 20
adam.nagy
in reply to: AlexFielder

Hi Alex,

 

I'm told there is still no API for it. 😞

Please do vote for it on the IdeaStation though - that could help:

 

https://forums.autodesk.com/t5/inventor-ideas/allow-quot-project-to-surface-quot-with-api-in-3d-sket...

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 20 of 20
ravikmb5
in reply to: adam.nagy

Is this API Feature Added in 2018

Please mark this response as Problem Solved if it answers your question.
----------------------------------------------------------------------------------------------
Ravi Kumar MB,
i7 860 Dell Studio XPS Win 7 64 bit 12 Gb RAM & HP Z220 SFF Workstation
Autodesk Inventor Certified professional 2016
Email: ravikmb5@gmail.com





Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report