<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Attribute to move to block without the old ATT in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3618526#M53334</link>
    <description>&lt;P&gt;Just a question&lt;/P&gt;&lt;P&gt;What is your Acad version, because I'm using a A2010 only?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="arial,helvetica,sans-serif"&gt;~'J'~&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Sep 2012 12:40:04 GMT</pubDate>
    <dc:creator>Hallex</dc:creator>
    <dc:date>2012-09-13T12:40:04Z</dc:date>
    <item>
      <title>Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3612736#M53326</link>
      <description>&lt;P&gt;Hello I can help defense.&lt;BR /&gt;How can I add an attribute to a block without the other attributes to move from their position.&lt;BR /&gt;With the ATTSYNC belongs unfortunately not because the old attributes moved back to the original places that I will not.&lt;BR /&gt;Please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;(Attribut zu Block ohne die alten ATT zu verschieben)&lt;/P&gt;&lt;P&gt;Hallo kann mir wehr Helfen.&lt;BR /&gt;Wie kann ich ein Attribut zu einem Block hinzufügen ohne die anderen Attribute von ihrer Position zu verschieben.&lt;BR /&gt;Mit ATTSync gehrt das leider nicht da werden die alten Attribute wieder auf die Originalplätze verschoben das will ich aber nicht.&lt;BR /&gt;Bitte um Hilfe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2012 12:27:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3612736#M53326</guid>
      <dc:creator>CAD-Heinz</dc:creator>
      <dc:date>2012-09-10T12:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3615892#M53327</link>
      <description>&lt;P&gt;Can not Help&lt;/P&gt;&lt;P&gt;pity &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kann keiner Helfen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Schade&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 04:54:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3615892#M53327</guid>
      <dc:creator>CAD-Heinz</dc:creator>
      <dc:date>2012-09-12T04:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3615970#M53328</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After adding the attribute definition to the block definition, you have to add the new attribute refrence to all block refrences in the database (i.e. synchronize only the new attribute).&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 07:00:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3615970#M53328</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2012-09-12T07:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3616004#M53329</link>
      <description>&lt;P&gt;Thanks for reply&lt;BR /&gt;Unfortunately, I have no idea about. Net&lt;BR /&gt;I hoped that such a defense program has been.&lt;BR /&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Danke für Antwort&lt;BR /&gt;Leider habe ich keine Ahnung von .net&lt;BR /&gt;ich habe gehofft das wehr so ein Programm schon hat.&lt;BR /&gt;Danke&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 07:18:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3616004#M53329</guid>
      <dc:creator>CAD-Heinz</dc:creator>
      <dc:date>2012-09-12T07:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3616918#M53330</link>
      <description>&lt;P&gt;Try this code, just you have to change block name,&lt;/P&gt;&lt;P&gt;new tag, prompt and default attribute value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        //using Autodesk.AutoCAD.Interop.Common;
        //using Autodesk.AutoCAD.Interop;
        // Add new attribute and synchronize all blockreferences



        [CommandMethod("nea")]
        public static void AddNewAtt()
        {

            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead, false);

                if (!bt.Has("PART"))
                {
                    ed.WriteMessage("\nBlock definition TEST does not  exist");
                    return;
                }

                List&amp;lt;AttributeDefinition&amp;gt; attColl = new List&amp;lt;AttributeDefinition&amp;gt;();

                BlockTableRecord btr = (BlockTableRecord)tr.GetObject(bt["PART"], OpenMode.ForRead, false);
                
                foreach (ObjectId adefId in btr)
                {
                    DBObject attObj = (DBObject)tr.GetObject(adefId, OpenMode.ForRead, false);
                    
                    if (attObj.GetRXClass().Name == "AcDbAttributeDefinition")
                    {
                        AttributeDefinition attObjDef = attObj as AttributeDefinition;
                        if (attObjDef != null)
                        {

                            attColl.Add(attObjDef);
                        }
                    }
                }
                AttributeDefinition[] atts = new AttributeDefinition[] { };

                atts = attColl.ToArray();
                //sort attribute location by X then by Y
                Array.Sort(atts, (AttributeDefinition x, AttributeDefinition y) =&amp;gt; 
                    ((x.Position.Y.CompareTo(y.Position.Y)) +
                    (y.Position.X.CompareTo(x.Position.X))));


                // get a location of the last AttributeDefinition in the 
                // block definition

                AttributeDefinition lastAtt = atts[0];
              
              Point3d Oldloc = lastAtt.Position;
              double attTxtHeight = lastAtt.Height;
              ed.WriteMessage("\n{0:f3}", attTxtHeight);
                // calculate location of the new AttributeDefinition in the 
                // block definition 
                
              Point3d ptNewloc = new Point3d(Oldloc.X, Oldloc.Y - attTxtHeight * 1.97, 0) + btr.Origin.GetAsVector();
                //// create a AttributeDefinition
              // specify the text,tag and prompt

              string strValue = "[ Enter a new value here ]";

              string strTag = "[ Enter a new tag here ]";

              string strPrompt = "[ Enter a new prompt here ]";
              // used text style of the last attribute definition
              AttributeDefinition attDef = new AttributeDefinition(ptNewloc, strValue, strTag, strPrompt, lastAtt.TextStyleId);
              attDef.Height = 0.12;
              attDef.Layer = "0";
              attDef.Color = Autodesk.AutoCAD.Colors.Color.FromColorIndex(ColorMethod.ByAci, 0);
              attDef.LinetypeId = lastAtt.LinetypeId;
              attDef.Height = lastAtt.Height;
              attDef.TextStyleId = lastAtt.TextStyleId;

              attDef.Annotative = lastAtt.Annotative;
              attDef.Preset = lastAtt.Preset;
              attDef.Invisible = lastAtt.Invisible;
              attDef.Constant = lastAtt.Constant;
              attDef.Justify = lastAtt.Justify;
              attDef.AlignmentPoint = ptNewloc;
              attDef.LockPositionInBlock = lastAtt.LockPositionInBlock;
              attDef.AdjustAlignment(db);
              // append the AttributeDefinition to the definition 
              btr.UpgradeOpen();
              btr.AppendEntity(attDef);
              tr.AddNewlyCreatedDBObject(attDef, true);
              btr.DowngradeOpen();

                tr.Commit();

                Autodesk.AutoCAD.Interop.AcadDocument acdoc = (Autodesk.AutoCAD.Interop.AcadDocument)doc.AcadDocument;

                AcadBlock acBlk = btr.AcadObject as AcadBlock;

                acdoc.SendCommand("_.ATTSYNC _N " + acBlk.Name + "\n");

            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Tested on A2010 only&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;~'J'~&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 13:49:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3616918#M53330</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2012-09-12T13:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3617470#M53331</link>
      <description>&lt;P&gt;Thanks for the help only times&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately it can not start&lt;BR /&gt;Get error message&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kann es leider nicht starten&lt;/P&gt;&lt;P&gt;Bekommen Fehlermeldung&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Fehler 1 Klasse, Delegat, Enumeration, Schnittstelle oder Struktur erwartet.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Fehler 3 Bezeichner erwartet&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 18:06:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3617470#M53331</guid>
      <dc:creator>CAD-Heinz</dc:creator>
      <dc:date>2012-09-12T18:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3617494#M53332</link>
      <description>&lt;P&gt;Try add namespace&lt;/P&gt;&lt;PRE&gt;using System.Linq;&lt;/PRE&gt;&lt;P&gt;Or use your own method to calculate position&lt;/P&gt;&lt;P&gt;of last attribute wthin the block definition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="arial,helvetica,sans-serif"&gt;~'J'~&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 18:21:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3617494#M53332</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2012-09-12T18:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3618120#M53333</link>
      <description>&lt;P&gt;Will not run for&lt;BR /&gt;these are my settings&lt;BR /&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bekomme das nicht zum laufen&lt;/P&gt;&lt;P&gt;das sind meine einstellungen&lt;/P&gt;&lt;P&gt;Danke&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using System;&lt;BR /&gt;using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;using Autodesk.AutoCAD.ApplicationServices;&lt;BR /&gt;using Autodesk.AutoCAD.DatabaseServices;&lt;BR /&gt;using Autodesk.AutoCAD.Geometry;&lt;BR /&gt;using Autodesk.AutoCAD.EditorInput;&lt;BR /&gt;using Autodesk.AutoCAD.Interop.Common;&lt;BR /&gt;using Autodesk.AutoCAD.Interop;&lt;BR /&gt;using System.Linq;&lt;/P&gt;&lt;P&gt;Add new attribute and synchronize all blockreferences&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2012 06:12:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3618120#M53333</guid>
      <dc:creator>CAD-Heinz</dc:creator>
      <dc:date>2012-09-13T06:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3618526#M53334</link>
      <description>&lt;P&gt;Just a question&lt;/P&gt;&lt;P&gt;What is your Acad version, because I'm using a A2010 only?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="arial,helvetica,sans-serif"&gt;~'J'~&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2012 12:40:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3618526#M53334</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2012-09-13T12:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3618534#M53335</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Autocad 2013&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hallo&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Autocad 2013&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2012 12:42:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3618534#M53335</guid>
      <dc:creator>CAD-Heinz</dc:creator>
      <dc:date>2012-09-13T12:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3618918#M53336</link>
      <description>&lt;P&gt;Well,&lt;/P&gt;&lt;P&gt;I haven't have this version on my machine,&lt;/P&gt;&lt;P&gt;but I will try to rewrite&amp;nbsp;the code&amp;nbsp;without using Interop later,&lt;/P&gt;&lt;P&gt;no warrantee though,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;~'J'~&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2012 15:08:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3618918#M53336</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2012-09-13T15:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619008#M53337</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;If that would not be possible, I prefer to Lisp, a little?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ich danke Ihnen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wäre das in Lisp nicht möglich?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2012 15:52:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619008#M53337</guid>
      <dc:creator>CAD-Heinz</dc:creator>
      <dc:date>2012-09-13T15:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619038#M53338</link>
      <description>&lt;P&gt;Try this code instead, but you have to invoke command ATTSYNC&lt;/P&gt;&lt;P&gt;manually after:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        //        #region "System"

        //using System;
        //using System.IO;
        //using System.Collections.Generic;
        //using System.Text;
        //using System.Reflection;

        //      #endregion


        //        #region "AutoCAD Imports"

        //using Autodesk.AutoCAD.Runtime;
        //using Autodesk.AutoCAD.ApplicationServices;
        //using Autodesk.AutoCAD.DatabaseServices;
        //using Autodesk.AutoCAD.Geometry;
        //using Autodesk.AutoCAD.EditorInput;
        //using Autodesk.AutoCAD.Colors;

        //      #endregion

        // import accoremgd.dll
        [CommandMethod("nea")]
        public static void AddNewAtt()
        {
            string blkName = "PART";
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead, false);

                if (!bt.Has(blkName))
                {
                    ed.WriteMessage("\nBlock definition TEST does not  exist");
                    return;
                }

                double dx = new double();
                double dy = new double();
                BlockTableRecord btr = (BlockTableRecord)tr.GetObject(bt[blkName], OpenMode.ForRead, false);
                
                int cnt = 0;
                AttributeDefinition matchAtt = new AttributeDefinition();
                foreach (ObjectId adefId in btr)
                {
                    DBObject attObj = (DBObject)tr.GetObject(adefId, OpenMode.ForRead, false);

                    if (attObj.GetRXClass().Name == "AcDbAttributeDefinition")
                    {
                        AttributeDefinition attObjDef = attObj as AttributeDefinition;
                        if (cnt == 0)
                        {
                            matchAtt = attObjDef;
                            dx = matchAtt.Position.X;
                            dy = matchAtt.Position.Y;
                            cnt += 1;
                        }
                        if (attObjDef != null)
                        {
                            Point3d ip = attObjDef.Position;
                            if ((attObjDef.Position.X &amp;gt;= dx) &amp;amp;&amp;amp; (attObjDef.Position.Y &amp;lt;= dy))
                            {
                                dx = attObjDef.Position.X;
                                dy = attObjDef.Position.Y;
                            }
                        }
                    }
                }


                // get a location of the last AttributeDefinition in the 
                // block definition
                Point3d Oldloc = matchAtt.Position;
                double attTxtHeight = matchAtt.Height;
                ed.WriteMessage("\n{0:f3}", attTxtHeight);
                // calculate location of the new AttributeDefinition in the 
                // block definition 

                Point3d ptNewloc = new Point3d(dx, dy - attTxtHeight * 1.97, btr.Origin.Z) + btr.Origin.GetAsVector();
                //// create a AttributeDefinition
                // specify the text,tag and prompt

                string strValue = "[ Enter a new value here ]";

                string strTag = "[ Enter a new tag here ]";

                string strPrompt = "[ Enter a new prompt here ]";
                // used text style of the last attribute definition
                AttributeDefinition attDef = new AttributeDefinition(ptNewloc, strValue, strTag, strPrompt, matchAtt.TextStyleId);
                attDef.Height = matchAtt.Height;
                attDef.Layer = "0";
                attDef.Color = Autodesk.AutoCAD.Colors.Color.FromColorIndex(ColorMethod.ByAci, 0);
                attDef.LinetypeId = matchAtt.LinetypeId;
                attDef.Height = matchAtt.Height;
                attDef.TextStyleId = matchAtt.TextStyleId;

                attDef.Annotative = matchAtt.Annotative;
                attDef.Preset = matchAtt.Preset;
                attDef.Invisible = matchAtt.Invisible;
                attDef.Constant = matchAtt.Constant;
                attDef.Justify = matchAtt.Justify;
                attDef.AlignmentPoint = ptNewloc;
                attDef.LockPositionInBlock = matchAtt.LockPositionInBlock;
                attDef.AdjustAlignment(db);
                // append the AttributeDefinition to the definition 
                btr.UpgradeOpen();
                btr.AppendEntity(attDef);
                tr.AddNewlyCreatedDBObject(attDef, true);
                btr.DowngradeOpen();

                tr.Commit();

                ed.WriteMessage("nPerform \"_ATTSYNC _N " + blkName + "\" + command manually");
              
            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Change block name within the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;~'J'~&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2012 16:07:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619038#M53338</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2012-09-13T16:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619098#M53339</link>
      <description>&lt;P&gt;Thanks for the effort.&lt;/P&gt;&lt;P&gt;But unfortunately, I still have an error message&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Danke für die Mühe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aber leider habe ich immer noch einen Fehlermeldung&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2012 16:52:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619098#M53339</guid>
      <dc:creator>CAD-Heinz</dc:creator>
      <dc:date>2012-09-13T16:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619150#M53340</link>
      <description>&lt;P&gt;Try to remove &lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;static&lt;/FONT&gt;&lt;/STRONG&gt; from void&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000" face="arial,helvetica,sans-serif"&gt;~'J'~&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2012 17:21:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619150#M53340</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2012-09-13T17:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619200#M53341</link>
      <description>&lt;P&gt;Try this lisp you asked for&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun add_att_to_block	(data_list /   acsp adoc att attpt atts blk blkent blk_obj blocks bname hgt inspt lastatt orig pt pts rot)
  (vl-load-com)
  (setq	adoc (vla-get-activedocument
	       (vlax-get-acad-object)
	     )
  )
  (if (= 1 (vlax-get-property adoc 'Activespace))
    (setq acsp (vla-get-modelspace adoc))
    (setq acsp (vla-get-paperspace adoc))
  )
  (setq blocks (vla-get-blocks adoc))
  (vla-startundomark adoc)
  
  (setq	blk	(vlax-ename-&amp;gt;vla-object (setq blkent(car (entsel "\nSelect attributed block: "))))
	inspt (vlax-get blk 'insertionpoint)
	bname	(vla-get-effectivename blk)
	blk_obj	(vla-item blocks bname)
	orig (vlax-get blk_obj 'origin)
	atts (vlax-invoke blk 'Getattributes)
  )
  (setq pts nil)
  (foreach att atts
    (setq pts (cons (vlax-get att 'insertionpoint) pts)))
  (setq pts (vl-sort pts '(lambda( a b) (and (&amp;gt;= (car a)(car b))(&amp;lt;= (cadr a)(cadr b))))))
  (setq pt (car pts))
  
  (setq lastatt (last (vlax-invoke blk 'Getattributes)))
  (setq hgt (vla-get-height lastatt))
  (setq rot (vla-get-rotation lastatt))  
  (setq attpt (mapcar '-  (list (car  pt)(- (cadr pt)(* hgt 1.97)) (caddr pt)) inspt ))
  (setq	att (vla-AddAttribute
	      blk_obj
	      hgt
	      acAttributeModePreset
	      (car data_list)
	    (vlax-3d-point attpt)
	      (cadr data_list)
	      (caddr data_list)
	    )
  )
  (vla-put-alignment att (vla-get-alignment lastatt))
  (vla-put-textalignmentpoint
    att
    (vlax-3d-point attpt)

  )
  (vla-put-rotation att rot)
  (vla-update (vlax-get-acad-object))
  (vlax-release-object blk)
  (vlax-release-object blk_obj)
  (setvar "cmdecho" 0)
  (command "_attsync" "_N" bname)
  (setvar "cmdecho" 1)
  (vla-regen adoc acactiveviewport)
  (vla-endundomark adoc)
  (princ)
)

;;usage:
(defun C:ia()
  ;; add Prompt, Tag and default value in list:
(add_att_to_block (list "Prompt" "TAG" "Value"))
  (princ)
  )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000" face="arial,helvetica,sans-serif"&gt;~'J'~&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2012 17:53:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619200#M53341</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2012-09-13T17:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619250#M53342</link>
      <description>&lt;P&gt;Thank you'll morning testing have not got Autocad&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Danke werde das Morgen Testen habe hier kein Autocad&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2012 18:11:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619250#M53342</guid>
      <dc:creator>CAD-Heinz</dc:creator>
      <dc:date>2012-09-13T18:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619356#M53343</link>
      <description>&lt;P&gt;Try code from attached text file&lt;/P&gt;&lt;P&gt;don't forget to rename block name and&lt;/P&gt;&lt;P&gt;your project name within the class&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="arial,helvetica,sans-serif"&gt;~'J'~&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2012 19:13:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619356#M53343</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2012-09-13T19:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619808#M53344</link>
      <description>&lt;P&gt;Thank you&lt;BR /&gt;The Lisp works but not quite what I mean&lt;BR /&gt;The old attribute should not be moved&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Danke&lt;BR /&gt;Das Lisp funktioniert aber nicht ganz so wie ich meine&lt;BR /&gt;Das alte Attribut sollte nicht verschoben werden&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2012 04:45:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619808#M53344</guid>
      <dc:creator>CAD-Heinz</dc:creator>
      <dc:date>2012-09-14T04:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute to move to block without the old ATT</title>
      <link>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619822#M53345</link>
      <description>&lt;P&gt;I said again. Net now runs&lt;BR /&gt;Super Thank you&lt;BR /&gt;But the old Att moves&lt;BR /&gt;and I should be able to select the block&lt;BR /&gt;Thank you very much&lt;BR /&gt;they are the best&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So ich nochmal das .net läuft jetzt auch&lt;BR /&gt;Super Danke&lt;BR /&gt;aber das alte Att wird verschoben&lt;BR /&gt;und ich sollte den Block auswählen können&lt;BR /&gt;Vielen Dank&lt;BR /&gt;sie sind der Beste&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2012 05:03:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attribute-to-move-to-block-without-the-old-att/m-p/3619822#M53345</guid>
      <dc:creator>CAD-Heinz</dc:creator>
      <dc:date>2012-09-14T05:03:21Z</dc:date>
    </item>
  </channel>
</rss>

