I'm working on a c# program designed to insert a block already on the autocad drawing to any place the user clicks on and automatically add a string value to the first custom attribute. I've done part of this by creating a new block reference with the new clicked point location and the existing block name.
Only for some reason the two custom attributes on the existing block are not present on the new block, it just shows the lines of the block with no text. See small portion of the program below. Does anyone know why the existing block attributes are not being added to the new block, and if so how would I go about doing so? I've gone through a number of forums on the matter and they all show how to create brand new attributes, rather than getting predefined attributes from the existing block and adding them to the new.
Scale3d blkScale = new Scale3d(drgScalemm, drgScalemm, drgScalemm);
ObjectId bdId = bt[blkName];
Point3d pt = ptInsert.Value;
BlockReference insblkref = new BlockReference(pt, bdId);
insblkref.ScaleFactors = blkScale;
insblkref.Rotation = 0;
btr.AppendEntity(insblkref);
tr.AddNewlyCreatedDBObject(insblkref, true);