<?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: Default Block Attributes in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2935038#M61706</link>
    <description>&lt;P&gt;That doesn't seem right.&amp;nbsp; If you explode the block, then it is no longer a block, and no reason to have attributes in the first place.&amp;nbsp; If that is what you want, then cool, but if not, then maybe if you post the code, people could help you out with a better solution.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Mar 2011 22:36:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-03-01T22:36:01Z</dc:date>
    <item>
      <title>Default Block Attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2934908#M61702</link>
      <description>&lt;P&gt;I can insert the block with my program. However I don't know how to accept the default values for the tags.&amp;nbsp; I do not want to edit the attributes, I just want to accept the defaults.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 21:15:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2934908#M61702</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-01T21:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Default Block Attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2934912#M61703</link>
      <description>&lt;P&gt;Just set the system variables ATTDIA, and ATTREQ to 0 When you insert the block.&lt;/P&gt;&lt;P&gt;Remember to set them back to the previous setting when done.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 21:19:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2934912#M61703</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2011-03-01T21:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Default Block Attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2934932#M61704</link>
      <description>&lt;P&gt;That does not work for a program.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 21:29:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2934932#M61704</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-01T21:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Default Block Attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2934962#M61705</link>
      <description>&lt;P&gt;got it. I had to explode the block.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 21:48:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2934962#M61705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-01T21:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Default Block Attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2935038#M61706</link>
      <description>&lt;P&gt;That doesn't seem right.&amp;nbsp; If you explode the block, then it is no longer a block, and no reason to have attributes in the first place.&amp;nbsp; If that is what you want, then cool, but if not, then maybe if you post the code, people could help you out with a better solution.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 22:36:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2935038#M61706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-01T22:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Default Block Attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2935128#M61707</link>
      <description>&lt;P&gt;En la guia de Autodesk hay un ejemplo:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;CommandMethod("AddBlockRef2")&amp;gt; _
    Public Sub AddBlockRef2()
        ' Obtener el documento y la base de datos activos
        Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
        Dim acCurDb As Database = acDoc.Database
 
        ' Obyener el nombre del bloque
        Dim acPr As PromptResult
        acPr = acDoc.Editor.GetString(ControlChars.Lf &amp;amp; "Indique el nombre del bloque: ")
 
        If acPr.Status &amp;lt;&amp;gt; PromptStatus.OK Then
            Return
        End If
 
        ' Iniciar una transaccion
        Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
 
            ' Abrir la tabla para bloques en modo lectura
            Dim acBlkTbl As BlockTable
            acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead)
 
 
            ' Comprobar si el bloque existe
            If acBlkTbl.Has(acPr.StringResult) Then
                ' Abrir el registro del bloque de Espacio Modelo para escritura
                Dim acBlkTblRec As BlockTableRecord
                acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), _
                                                OpenMode.ForWrite)
 
                ' Obtener una referencia del bloque
                Dim acBlk As BlockTableRecord = acTrans.GetObject( _
                acBlkTbl.Item(acPr.StringResult), OpenMode.ForRead, False)
 
                ' Crear una referencia a bloque
                Dim acBlkRef As New BlockReference(New Point3d(50, 50, 0), acBlk.ObjectId)
 
                ' Rotar 45º
                ' 45 *(Math.PI/180)
                acBlkRef.Rotation = 0.785
                ' Factor de escala
                acBlkRef.ScaleFactors = New Scale3d(50)
 
                ' Añadir el nuevo objeto al registro de la tabla para bloques
                ' y a la transaccion
                acBlkTblRec.AppendEntity(acBlkRef)
                acTrans.AddNewlyCreatedDBObject(acBlkRef, True)
 
                ' Si el bloque contiene atributos, añadirlos a la referencia a bloque
                If acBlk.HasAttributeDefinitions Then
                    For Each acObjId As ObjectId In acBlk
                        Dim acObj As DBObject = acTrans.GetObject(acObjId, OpenMode.ForRead, False)
                        Dim acAttDef As AttributeDefinition = TryCast(acObj, AttributeDefinition)
 
                        If acAttDef IsNot Nothing Then
                            If Not acAttDef.Constant Then
                                ' Crear una referencia de atributo
                                Dim acAttRef As AttributeReference = New AttributeReference
 
                                acAttRef.SetAttributeFromBlock(acAttDef, acBlkRef.BlockTransform)
 
                                ' Esto solo para AutoCAD 2008 o superior
                                ' Si el valor es texto de mutiples lineas
                                If acAttDef.IsMTextAttributeDefinition Then
                                    acAttRef.UpdateMTextAttribute()
                                End If
 
                                acAttRef.TextString = acAttDef.TextString
 
                                ' Agregar la referencia de atributo a la 
                                ' referencia a bloque y a la transaccion
                                acBlkRef.AttributeCollection.AppendAttribute(acAttRef)
                                acTrans.AddNewlyCreatedDBObject(acAttRef, True)
 
                            End If
                        End If
                    Next
                End If
 
                ' Confirmar los cambios
                acTrans.Commit()
            End If
 
        End Using
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2011 00:15:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2935128#M61707</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-02T00:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Default Block Attributes</title>
      <link>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2936106#M61708</link>
      <description>&lt;P&gt;I guess the block I was inserting was already a block and created a nested block.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2011 15:35:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/default-block-attributes/m-p/2936106#M61708</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-02T15:35:42Z</dc:date>
    </item>
  </channel>
</rss>

