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: 

Sketch Entities Mirror (involute curves)

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
ravikmb5
1164 Views, 8 Replies

Sketch Entities Mirror (involute curves)

i was writing ilogic code to Create Rack and Pinion

by Analytical geometry Method

 

Here is the image

Somehow i was not able to Mirror Involute Profile

 

mirror involute.png

 

 

Spur Gear Profiles.png

 

i am also failed to Pattern Entities

i was not able to Find Equavelent command in API For Circlular Pattern

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





8 REPLIES 8
Message 2 of 9
ekinsb
in reply to: ravikmb5

There is some functionality in the product that's missing in the API.  For example, the API does not currently support the creation of patterns in a sketch.  I don't know of any workaround for that.  The API also does not directly support the ability to do mirroring, however it does support some lower-level functionality so you can end up with the same result.  In general, it's better practice to mirror and pattern features rather than sketch geometry to create more complex geometry.  Specifically in your case, it would be better to create a single tooth and then mirror the extrusion to create the additional teeth.

 

When you use the mirror command in a sketch it's actually creating new geometry that is tied to the original using symmetry constraints.  You can see this if you do a mirror operation and then turn on the display of all of the geometric constraints.  In the case of a spline it's the points that the curve goes through that have the symmetry constraint.  Below is a program that illustrates how this can be used to creat a mirrored version of an existing curve.

 

Public Function TestMirror()
    Dim spline As SketchSpline
    Set spline = ThisApplication.CommandManager.Pick(kSketchCurveSplineFilter, "Select the spline")
    
    Dim line As SketchLine
    Set line = ThisApplication.CommandManager.Pick(kSketchCurveLinearFilter, "Select the symmetry line")
    
    Dim sp As SketchSpline
    Set sp = CreateMirroredSpline(spline, line)
End Function

Private Function CreateMirroredSpline(spline As SketchSpline, Axis As SketchLine) As SketchSpline
    ' Get the parent sketch.
    Dim sk As sketch
    Set sk = spline.Parent
    
    ' Create a copy of the existing spline.
    Dim fitPoints As ObjectCollection
    Set fitPoints = ThisApplication.TransientObjects.CreateObjectCollection
    Dim i As Integer
    For i = 1 To spline.FitPointCount
        Dim newPoint As SketchPoint
        Set newPoint = sk.SketchPoints.Add(spline.FitPoint(i).Geometry, False)
        
        ' Make each point symmetric.
        Call sk.GeometricConstraints.AddSymmetry(spline.FitPoint(i), newPoint, Axis)
        
        ' Add the new point to a collection.
        Call fitPoints.Add(newPoint)
    Next
    
    ' Create a spline that fits through the new points.
    Dim newSpline As SketchSpline
    Set newSpline = sk.SketchSplines.Add(fitPoints, spline.FitMethod)
End Function

 


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

i was trying to do something similar which is shown in this video

but unfornutely it didnt got in right way for me

 
--
Ravi Kumar mb
mb: +919845032338

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 4 of 9
adam.nagy
in reply to: ravikmb5

Hi Ravi,

 

Are you all set now or you need more help?

 

Cheers,

Adam



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

Thanks Brain and Adam

 

Mirroring Spline by above mentioned method is an interactive method

Patterning Lines in sketch was not supported by API

and Dimensioning between two end points of a line which has same start point

as ArcLength was not also possible in inventor

ArcLength.png

 

Creating individual Arcs between each segment then Placing Reference Dim between

those segments is tedious process

 

 

This is possible with Soildworks which is shown in this video

 

I also tried by 2D Equation Curves

it seems to have some bug which is mentioned in this

 

tmin wont start at 0

we have to replace it with 0.004 so involute is not accurate

bec of which i was not able add constraint between involute profile and Line Segment

 

Has anybody automated Rack and Pinion so Far

 

by Default Inventor API Should Support all the things which i can do manually

if not in all aspects

ATLEAST IN SKETCH ENVIRONMENT

 

IT SAVES LOT OF REPEATED LINE OF CODES IN MY PROGRAMME

 

patterns and mirroring are most important in sketches

 

 

 

 

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 6 of 9
GeorgK
in reply to: ravikmb5

 

http://forums.autodesk.com/autodesk/attachments/autodesk/78/338824/1/Spur%20Gear%20Tutorial.pdf

 

There is a model of an involute spur gear on cbliss.com:
http://www.cbliss.com/inventor/Parts/PowerTransmission/Involute Gear.zip

The creation of the involute curve is done via an embedded Excel spreadsheet, which by itself is worth looking at to see how it works.

 

https://grabcad.com/questions/creating-precise-involute-spur-gears-using-excel-and-autocad

Message 7 of 9
ravikmb5
in reply to: GeorgK

Thanks

 

i was just trying to create by API Method

https://www.youtube.com/watch?v=4zdu60I47DE

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 8 of 9
adam.nagy
in reply to: ravikmb5

I have logged a wish-list item to get API support for Mirror and Pattern inside a Sketch - request #51632



Adam Nagy
Autodesk Platform Services
Message 9 of 9
pwasserSE9SM
in reply to: adam.nagy

After spending quite a few weeks working on an add-in I reach a critical point to discover mirroring and patterning in sketches is not supported in the api.  A request for this functionality submitted 5 years ago seems to lie moribund. Workarounds are just not going to cut it. I think at this point I will write off my time and put it down to experience.

Peter

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

Post to forums  

Autodesk Design & Make Report