Hi,
Here's a working example with an existing polyline and a temporary circle (i.e. the newly created circle is not added to the database).
This example is written in C#, you could convert it with telerik code converter for example*, but assuming you're starting with .NET you should learn C# instead of VB because you'll find more valuable help and examples in C#.
[CommandMethod("TEST")]
public static void Test()
{
var doc = AcAp.DocumentManager.MdiActiveDocument;
var db = doc.Database;
var ed = doc.Editor;
// prompt the use to select a polyline
var peo = new PromptEntityOptions("\nSelect Polyline: ");
peo.SetRejectMessage("\nMust be a Polyline.");
peo.AddAllowedClass(typeof(Polyline), true);
var per = ed.GetEntity(peo);
if (per.Status != PromptStatus.OK)
return;
// prompt the user to specify center of the circle
var ppr = ed.GetPoint("\nSpecify the center: ");
if (ppr.Status != PromptStatus.OK)
return;
// prompt the user to specify the radius of the circle
var pdo = new PromptDistanceOptions("\nSpecify the radius: ");
pdo.BasePoint = ppr.Value;
pdo.UseBasePoint = true;
var pdr = ed.GetDistance(pdo);
if (pdr.Status != PromptStatus.OK)
return;
using (var tr = db.TransactionManager.StartTransaction())
{
// open the selected polyline for read
var pline = (Polyline)tr.GetObject(per.ObjectId, OpenMode.ForRead);
var points = new Point3dCollection();
// create a temporary circle
var center = ppr.Value.TransformBy(ed.CurrentUserCoordinateSystem);
double radius = pdr.Value;
// the using statement insures the circle to be disposed instead of been added to the database
using (var circle = new Circle(center, Vector3d.ZAxis, radius))
{
// search for intersection
pline.IntersectWith(circle, Intersect.OnBothOperands, points, IntPtr.Zero, IntPtr.Zero);
// print the output
if (points.Count > 0)
{
ed.WriteMessage("\nIntersections:");
foreach (Point3d point in points)
{
ed.WriteMessage($" {point:0.00}");
}
}
else
{
ed.WriteMessage("\nNone intersection.");
}
}
tr.Commit();
}
}
*if you use some automatic converter to convert C# to VB, take care the VB "Infer" and "Strict" options are "On" in your project