I tried below code I but it is only placing the numbers but not the bubble so in Image here Actual is what I am getting.

[CommandMethod("AddCalloutBubble")]
public static void AddCalloutBubble()
{
string blockPath = @"C:\\Program Files\\Autodesk2021\\AutoCAD 2021\\Sample\\en-us\\Dynamic Blocks\\Annotation - Imperial.dwg";
string blockName = "Callout Bubble - Imperial";
InsertBlock(blockPath, blockName);
}
private static void InsertBlock(string blockPath, string blockName)
{
var doc = Application.DocumentManager.MdiActiveDocument;
var db = doc.Database;
var ed = doc.Editor;
using (var tr = db.TransactionManager.StartTransaction())
{
var bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
ObjectId btrId = bt.Has(blockName) ?
bt[blockName] :
ImportBlock(db, blockName, blockPath);
if (btrId.IsNull)
{
ed.WriteMessage($"\nBlock '{blockName}' not found.");
return;
}
var cSpace = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
var br = new BlockReference(Point3d.Origin, btrId);
cSpace.AppendEntity(br);
tr.AddNewlyCreatedDBObject(br, true);
// add attribute references to the block reference
var btr = (BlockTableRecord)tr.GetObject(btrId, OpenMode.ForRead);
var attInfos = new Dictionary<string, TextInfo>();
if (btr.HasAttributeDefinitions)
{
foreach (ObjectId id in btr)
{
if (id.ObjectClass.DxfName == "ATTDEF")
{
var attDef = (AttributeDefinition)tr.GetObject(id, OpenMode.ForRead);
attInfos[attDef.Tag] = new TextInfo(
attDef.Position,
attDef.AlignmentPoint,
attDef.Justify != AttachmentPoint.BaseLeft,
attDef.Rotation);
var attRef = new AttributeReference();
attRef.SetAttributeFromBlock(attDef, br.BlockTransform);
attRef.TextString = attDef.TextString;
br.AttributeCollection.AppendAttribute(attRef);
tr.AddNewlyCreatedDBObject(attRef, true);
}
}
}
var jig = new InsertBlockJig(br, attInfos);
var pr = ed.Drag(jig);
if (pr.Status != PromptStatus.OK)
{
br.Erase();
}
tr.Commit();
}
}
private static ObjectId ImportBlock(Database destDb, string blockName, string sourceFileName)
{
if (System.IO.File.Exists(sourceFileName))
{
using (var sourceDb = new Database(false, true))
{
try
{
// Read the DWG into a side database
sourceDb.ReadDwgFile(sourceFileName, FileOpenMode.OpenForReadAndAllShare, true, "");
// Create a variable to store the block identifier
var id = ObjectId.Null;
using (var tr = new OpenCloseTransaction())
{
// Open the block table
var bt = (BlockTable)tr.GetObject(sourceDb.BlockTableId, OpenMode.ForRead, false);
// if the block table contains 'blockName', store it into the variable
if (bt.Has(blockName))
id = bt[blockName];
MessageBox.Show(blockName);
}
// if the variable is not null (i.e. the block was found)
if (!id.IsNull)
{
// Copy the block deinition from source to destination database
var blockIds = new ObjectIdCollection();
blockIds.Add(id);
var mapping = new IdMapping();
sourceDb.WblockCloneObjects(blockIds, destDb.BlockTableId, mapping, DuplicateRecordCloning.Replace, false);
// if the copy succeeded, return the ObjectId of the clone
if (mapping[id].IsCloned)
return mapping[id].Value;
}
}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
var ed = Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage("\nError during copy: " + ex.Message + "\n" + ex.StackTrace);
}
}
}
return ObjectId.Null;
}
struct TextInfo
{
public Point3d Position { get; private set; }
public Point3d Alignment { get; private set; }
public bool IsAligned { get; private set; }
public double Rotation { get; private set; }
public TextInfo(Point3d position, Point3d alignment, bool aligned, double rotation)
{
Position = position;
Alignment = alignment;
IsAligned = aligned;
Rotation = rotation;
}
}
class InsertBlockJig : EntityJig
{
BlockReference br;
Point3d pt;
Dictionary<string, TextInfo> attInfos;
public InsertBlockJig(BlockReference br, Dictionary<string, TextInfo> attInfos) : base(br)
{
this.br = br;
this.attInfos = attInfos;
}
protected override SamplerStatus Sampler(JigPrompts prompts)
{
var options = new JigPromptPointOptions("\nSpecify insertion point: ");
options.UserInputControls = UserInputControls.Accept3dCoordinates;
var result = prompts.AcquirePoint(options);
if (result.Value.IsEqualTo(pt))
return SamplerStatus.NoChange;
pt = result.Value;
return SamplerStatus.OK;
}
protected override bool Update()
{
br.Position = pt;
if (br.AttributeCollection.Count > 0)
{
var tr = br.Database.TransactionManager.TopTransaction;
foreach (ObjectId id in br.AttributeCollection)
{
var attRef = (AttributeReference)tr.GetObject(id, OpenMode.ForRead);
string tag = attRef.Tag.ToUpper();
if (attInfos.ContainsKey(tag))
{
TextInfo ti = attInfos[tag];
attRef.Position = ti.Position.TransformBy(br.BlockTransform);
if (ti.IsAligned)
{
attRef.AlignmentPoint =
ti.Alignment.TransformBy(br.BlockTransform);
attRef.AdjustAlignment(br.Database);
}
if (attRef.IsMTextAttribute)
{
attRef.UpdateMTextAttribute();
}
}
}
}
return true;
}
}
}