01-30-2023
08:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-30-2023
08:22 PM
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?
Solved! Go to Solution.
01-31-2023
03:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-31-2023
03:27 AM
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
01-31-2023
08:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-31-2023
08:11 PM
That works great, thankyou.
Any idea how to add a coincident constraint between the circle circumference and the 3 points?
Any idea how to add a coincident constraint between the circle circumference and the 3 points?
02-01-2023
01:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-01-2023
01:59 AM
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)
02-01-2023
12:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report