using System;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
[assembly: CommandClass(typeof(AttributeWidthFactor.MyCommands))]
namespace AttributeWidthFactor
{
public class MyCommands
{
[CommandMethod("AttWidth")]
public static void SetAttrWidthFactor()
{
Document dwg = Application.DocumentManager.MdiActiveDocument;
Editor ed = dwg.Editor;
//Pick an attributereference in a block
PromptNestedEntityOptions opt = new
PromptNestedEntityOptions("\nPick an attribute:");
PromptNestedEntityResult res = ed.GetNestedEntity(opt);
if (res.Status == PromptStatus.OK)
{