<?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 orientation of block and its multiple attributes in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/orientation-of-block-and-its-multiple-attributes/m-p/2134264#M22111</link>
    <description>I've got a block with four visible text attributes, when the block is inserted at the default of 0 degrees my VBA code will only show one of the attributes as intended and I retain other functionality as well like rotating the text string and altering its content, however when the block is inserted at another angle (90,180, or 270) my code won't work. Even though it identifies the block as rotated it won't suppress three of the four attributes as intended. The notion is to insert a multitude of these blocks at angles of 0,90,180 and 270 with the attributes modes set to invisible, then later, using a userform, set that mode to false and only display the attribute that corresponds to the orientation of the block. My code allows full comand of the attribute when the block inserted at default of 0, i.e. can change the content and rotation of the attribute, but I have no control of the attributes when the block is inserted at any other orientation. Any thoughts are greatly appreciated.</description>
    <pubDate>Mon, 10 Dec 2007 01:42:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-12-10T01:42:20Z</dc:date>
    <item>
      <title>orientation of block and its multiple attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/orientation-of-block-and-its-multiple-attributes/m-p/2134264#M22111</link>
      <description>I've got a block with four visible text attributes, when the block is inserted at the default of 0 degrees my VBA code will only show one of the attributes as intended and I retain other functionality as well like rotating the text string and altering its content, however when the block is inserted at another angle (90,180, or 270) my code won't work. Even though it identifies the block as rotated it won't suppress three of the four attributes as intended. The notion is to insert a multitude of these blocks at angles of 0,90,180 and 270 with the attributes modes set to invisible, then later, using a userform, set that mode to false and only display the attribute that corresponds to the orientation of the block. My code allows full comand of the attribute when the block inserted at default of 0, i.e. can change the content and rotation of the attribute, but I have no control of the attributes when the block is inserted at any other orientation. Any thoughts are greatly appreciated.</description>
      <pubDate>Mon, 10 Dec 2007 01:42:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/orientation-of-block-and-its-multiple-attributes/m-p/2134264#M22111</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-12-10T01:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: orientation of block and its multiple attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/orientation-of-block-and-its-multiple-attributes/m-p/2134265#M22112</link>
      <description>Here is one from my very first experiences&lt;BR /&gt;
This will not work with constant attributes&lt;BR /&gt;
&lt;BR /&gt;
[code]&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
' make sure you set 'Break on Unhadled Errors' in Tools-&amp;gt;&lt;BR /&gt;
' Option-&amp;gt;General tab-&amp;gt;Error Trapping field&lt;BR /&gt;
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'&lt;BR /&gt;
Sub FixRotAtt()&lt;BR /&gt;
     Dim oSpace As AcadBlock&lt;BR /&gt;
     Dim oblkRef As AcadBlockReference&lt;BR /&gt;
     Dim attVar() As AcadAttributeReference&lt;BR /&gt;
     Dim oAtt As AcadAttributeReference&lt;BR /&gt;
     Dim oEnt As AcadEntity&lt;BR /&gt;
     Dim blkName As String&lt;BR /&gt;
     Dim k As Integer&lt;BR /&gt;
     Dim varPt As Variant&lt;BR /&gt;
     Dim dblRot As Double&lt;BR /&gt;
&lt;BR /&gt;
     blkName = InputBox(Prompt:=vbCr &amp;amp; "Enter the block name: ", _&lt;BR /&gt;
                        Title:="Insert Block(s)", Default:="MLR")&lt;BR /&gt;
&lt;BR /&gt;
     On Error GoTo Err_Control&lt;BR /&gt;
&lt;BR /&gt;
     With ThisDrawing&lt;BR /&gt;
     &lt;BR /&gt;
          If .GetVariable("TILEMODE") = 1 Then&lt;BR /&gt;
               Set oSpace = .ModelSpace&lt;BR /&gt;
          Else&lt;BR /&gt;
               Set oSpace = .PaperSpace&lt;BR /&gt;
          End If&lt;BR /&gt;
          &lt;BR /&gt;
     End With&lt;BR /&gt;
&lt;BR /&gt;
     While Not IsNull(varPt)&lt;BR /&gt;
&lt;BR /&gt;
          With ThisDrawing&lt;BR /&gt;
&lt;BR /&gt;
               varPt = .Utility.GetPoint(, vbCrLf &amp;amp; "Pick insertion point of block (or hit Enter to Exit): ")&lt;BR /&gt;
               dblRot = .Utility.GetAngle(varPt, vbCrLf &amp;amp; "Digitize the rotation angle:")&lt;BR /&gt;
&lt;BR /&gt;
               Set oblkRef = oSpace.InsertBlock(varPt, blkName, 1, 1, 1, dblRot)&lt;BR /&gt;
&lt;BR /&gt;
               attVar = oblkRef.GetAttributes&lt;BR /&gt;
&lt;BR /&gt;
               For k = 0 To UBound(attVar)&lt;BR /&gt;
                    attVar(k).Rotation = 0&lt;BR /&gt;
                    attVar(k).Update&lt;BR /&gt;
               Next k&lt;BR /&gt;
&lt;BR /&gt;
               oblkRef.Update&lt;BR /&gt;
&lt;BR /&gt;
          End With&lt;BR /&gt;
&lt;BR /&gt;
     Wend&lt;BR /&gt;
&lt;BR /&gt;
Exit_Here:&lt;BR /&gt;
     Exit Sub&lt;BR /&gt;
&lt;BR /&gt;
Err_Control:&lt;BR /&gt;
     If Err.Number &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;
          If Err.Description Like "User input is a keyword" Then&lt;BR /&gt;
               MsgBox "Interrupted by user", vbInformation&lt;BR /&gt;
          Else&lt;BR /&gt;
               MsgBox Err.Description&lt;BR /&gt;
          End If&lt;BR /&gt;
     End If&lt;BR /&gt;
     Resume Exit_Here&lt;BR /&gt;
     &lt;BR /&gt;
End Sub&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Mon, 10 Dec 2007 06:30:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/orientation-of-block-and-its-multiple-attributes/m-p/2134265#M22112</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-12-10T06:30:12Z</dc:date>
    </item>
  </channel>
</rss>

