Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Draw a construction circle whose circumference is constrained by 3x selected points.

arron.craig
Collaborator

Draw a construction circle whose circumference is constrained by 3x selected points.

arron.craig
Collaborator
Collaborator

I'm essentially wanting a "3 point circle" from AutoCAD, however I can't do this project in AutoCAD.

 

I would like to be able to select 3x points and for the iLogic rule to draw a construction circle and coincident constraint it's perimeter to those three points. And then place a center point on the circles center. 

 

Does anyone have some code kicking around that would do this?  

 

Inventor_zy8iIAErLd.png

Je9LToItt7.png

0 Likes
Reply
Accepted solutions (1)
381 Views
4 Replies
Replies (4)

Cadkunde.nl
Collaborator
Collaborator
Dim oDoc As PartDocument = ThisDoc.Document

Dim oTG As TransientGeometry = ThisApplication.TransientGeometry

Dim p1 As Inventor.SketchPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketchPointFilter, "Select p1")
Dim p2 As Inventor.SketchPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketchPointFilter, "Select p2")
Dim p3 As Inventor.SketchPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketchPointFilter, "Select p3")

Dim oSketch As PlanarSketch = ThisApplication.ActiveEditObject

Dim oPoint1 As Inventor.Point2d = oTG.CreatePoint2d(p1.Geometry.X, p1.Geometry.Y)
Dim oPoint2 As Inventor.Point2d = oTG.CreatePoint2d(p2.Geometry.X, p2.Geometry.Y)
Dim oPoint3 As Inventor.Point2d = oTG.CreatePoint2d(p3.Geometry.X, p3.Geometry.Y)

Dim oCircle As Inventor.SketchCircle = oSketch.SketchCircles.AddByThreePoints(oPoint1, oPoint2, oPoint3)

oCircle.Construction = True
oCircle.CenterSketchPoint.HoleCenter = True

arron.craig
Collaborator
Collaborator
That works great, thankyou.

Any idea how to add a coincident constraint between the circle circumference and the 3 points?
0 Likes

Cadkunde.nl
Collaborator
Collaborator
Accepted solution
Dim oDoc As PartDocument = ThisDoc.Document

Dim oTG As TransientGeometry = ThisApplication.TransientGeometry

Dim p1 As Inventor.SketchPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketchPointFilter, "Select p1")
Dim p2 As Inventor.SketchPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketchPointFilter, "Select p2")
Dim p3 As Inventor.SketchPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketchPointFilter, "Select p3")

Dim oSketch As PlanarSketch = ThisApplication.ActiveEditObject

Dim oPoint1 As Inventor.Point2d = oTG.CreatePoint2d(p1.Geometry.X, p1.Geometry.Y)
Dim oPoint2 As Inventor.Point2d = oTG.CreatePoint2d(p2.Geometry.X, p2.Geometry.Y)
Dim oPoint3 As Inventor.Point2d = oTG.CreatePoint2d(p3.Geometry.X, p3.Geometry.Y)

Dim oCircle As Inventor.SketchCircle = oSketch.SketchCircles.AddByThreePoints(oPoint1, oPoint2, oPoint3)

oCircle.Construction = True
oCircle.CenterSketchPoint.HoleCenter = True

oSketch.GeometricConstraints.AddCoincident(oCircle, p1)
oSketch.GeometricConstraints.AddCoincident(oCircle, p2)
oSketch.GeometricConstraints.AddCoincident(oCircle, p3)

arron.craig
Collaborator
Collaborator

Much appreciated. Thankyou

0 Likes