So, the issue you have is quite simple: as CAD programmer, write your own code that is equivalent to the Editor.SelectFence() or SelectCrossingPolygon[Window]() (in your case, it should be the latter). Something like:
protected override SamplerStatus Sampler(JigPrompts prompts)
{
_dwg.Database.Orthomode = true;
var jigOptions = new JigPromptPointOptions();
jigOptions.SetMessageAndKeywords("\nInsert Sprinkler or [Rotate]:", "Rotate");
var jigResult = prompts.AcquirePoint(jigOptions);
switch (jigResult.Status)
{
case PromptStatus.Keyword:
//Rotate blkRef and region
break;
case PromptStatus.OK:
switch (_movingPoint.Equals(jigResult.Value))
{
case true:
return SamplerStatus.NoChange;
case false:
var reflectedPoint = _wallsAndSoffits.BaseLine.GetClosestPointTo(
jigResult.Value, false);
_sideWallBlkReference.Position = reflectedPoint;
var movingVecotr = _movingPoint.GetVectorTo(reflectedPoint);
_pcaRegion.TransformBy(Matrix3d.Displacement(movingVecotr));
_pcaPolyline.TransformBy(Matrix3d.Displacement(movingVecotr));
_movingPoint = reflectedPoint;
// assume you have a Transaction started when the dragging begins
var objectsIndisde = SelectCrossingPolygon(_pcaPolyline)
foreach(Entity ent in objectsInside)
{
if(selected is Line)
{
//check distance of _moving point to line, if less than xxx do stuff
}
else if(selected is BlockReference)
{
//check distance of _moving point and selected, if less than xxx insert aligned dimension
}
else if(selected is polylinesegment)
{
//do some stuff to the region
}
}
return SamplerStatus.OK;
}
break;
default:
return SamplerStatus.Cancel;
}
return SamplerStatus.NoChange;
}
private List<Entity> SelectCrossingPolygon(Polyline boundary)
{
var ents=new List<Entity>();
var space=(BlockTableRecord)_tran.GetObject(_db.CurrentSpaceId, OpenMode.ForRead);
foreach (ObjectId entId in space)
{
var ent=(Entity)_tran.GetObject(entId, OpenMode.ForRead);
if (IsInsideOrCrossing(ent, boundary)) ents.Add(ents);
}
return ents;
}
private bool IsInsideOrCrossing(Entity ent, Polyline boundary)
{
// first test if there is intersection
var pts=new Point3dCollection
boundary.IntersectWith(ent, Intersect.OnBothOperants, pts, IntPtr.Zero, IntPtr.Zero);
if (pts.Count>0) return true
// if no intersection, get a point coordinate of anywhere of the entity:
// if it is curve (line, Arc, polyline...), use Start/End point; if it is
// block reference, use Insertion Point...
Point3d ptOnEntity = //get a point from the entity
return IsPointInsideBoundary(ptOnEntity, boundary);
}
private bool IsPointInsideBoundary(Point3d pt, Polyline boundary)
{
// There are quite a few code samples to compute whether a points
// is inside a polygon online. Do your search
}
HTH