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: 

vertex point where circle and curve meet

1 REPLY 1
Reply
Message 1 of 2
Anonymous
296 Views, 1 Reply

vertex point where circle and curve meet

Anonymous
Not applicable
- I need some serious VBA syntax help -
I have racked my brains raw trying to figure out how to get back the vertex point created by the tangent constraint in my drawing. I have a circle tangent to an elliptical arc and i NEED the coordinates of the point where they touch. Will someone please help alleviate my suffering. Thanks.
0 Likes

vertex point where circle and curve meet

- I need some serious VBA syntax help -
I have racked my brains raw trying to figure out how to get back the vertex point created by the tangent constraint in my drawing. I have a circle tangent to an elliptical arc and i NEED the coordinates of the point where they touch. Will someone please help alleviate my suffering. Thanks.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Anonymous
Not applicable

I use the following method:


Sub Circle2EllArc_TouchPoint()

{color:#339966}'Finds vertex point created by the tangent constraint
'between fixed circle and fixed elliptical arc
'This method works ONLY if the sketch geometry {color}{color:#ff0000}IS FIXED.{color}

Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oCompDef As PartComponentDefinition
Set oCompDef = oDoc.ComponentDefinition

{color:#339966}'reference to the specific sketch{color}
Dim oSketch As PlanarSketch
Set oSketch = oCompDef.Sketches.Item(1)

{color:#339966}'reference to the elliptical arc{color}
Dim eArc As SketchEllipticalArc
Set eArc = oSketch.SketchEllipticalArcs.Item(1)
{color:#339966}'reference to the circle{color}
Dim oCirc As SketchCircle
Set oCirc = oSketch.SketchCircles.Item(1)

{color:#339966}'Let's create sketchpoint
'It's position cannot be arbitrary, but you almost
'always have a chance to find appropriate coordinates.
'e.g. the midpoint between circle and arc centerpoints{color}
Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry
Dim oP As SketchPoint
Set oP = oSketch.SketchPoints.Add(oTG.CreatePoint2d(0, 0), False)

{color:#339966}'add two coincident constraints between our point and both curves{color}
Call oSketch.GeometricConstraints.AddCoincident(oP, eArc)
Call oSketch.GeometricConstraints.AddCoincident(oP, oCirc)

{color:#339966}'print touch point coordinates
{color}Debug.Print "X = "; oP.Geometry.X
Debug.Print "Y = "; oP.Geometry.Y

End Sub

Hope this helps.

ALink
0 Likes


I use the following method:


Sub Circle2EllArc_TouchPoint()

{color:#339966}'Finds vertex point created by the tangent constraint
'between fixed circle and fixed elliptical arc
'This method works ONLY if the sketch geometry {color}{color:#ff0000}IS FIXED.{color}

Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oCompDef As PartComponentDefinition
Set oCompDef = oDoc.ComponentDefinition

{color:#339966}'reference to the specific sketch{color}
Dim oSketch As PlanarSketch
Set oSketch = oCompDef.Sketches.Item(1)

{color:#339966}'reference to the elliptical arc{color}
Dim eArc As SketchEllipticalArc
Set eArc = oSketch.SketchEllipticalArcs.Item(1)
{color:#339966}'reference to the circle{color}
Dim oCirc As SketchCircle
Set oCirc = oSketch.SketchCircles.Item(1)

{color:#339966}'Let's create sketchpoint
'It's position cannot be arbitrary, but you almost
'always have a chance to find appropriate coordinates.
'e.g. the midpoint between circle and arc centerpoints{color}
Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry
Dim oP As SketchPoint
Set oP = oSketch.SketchPoints.Add(oTG.CreatePoint2d(0, 0), False)

{color:#339966}'add two coincident constraints between our point and both curves{color}
Call oSketch.GeometricConstraints.AddCoincident(oP, eArc)
Call oSketch.GeometricConstraints.AddCoincident(oP, oCirc)

{color:#339966}'print touch point coordinates
{color}Debug.Print "X = "; oP.Geometry.X
Debug.Print "Y = "; oP.Geometry.Y

End Sub

Hope this helps.

ALink

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

Post to forums  

Autodesk Design & Make Report