<?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: Blocks update in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/blocks-update/m-p/11913182#M1603</link>
    <description>&lt;P&gt;This is the solution:&lt;/P&gt;&lt;LI-CODE lang="general"&gt; Dim b As AcadBlock
    Dim L As AcadLine
    Dim pt(1) As Variant
    Dim s As Double, m As Double
    Dim i As Byte
    Dim PIL(0 To 2) As Double, PFL(0 To 2) As Double
    Dim num As Integer
    Dim k1 As String
    Dim Bl As AcadBlockReference
    
    Set layerObj = ThisDrawing.Layers.Add("Viguetas")
    ThisDrawing.ActiveLayer = layerObj
    layerObj.color = acMagenta
    
    Me.Hide
    pt(0) = ThisDrawing.Utility.GetPoint(, "Seleccione el punto inicial")
    pt(1) = ThisDrawing.Utility.GetPoint(, "Seleccione el punto final")
    Set L = ThisDrawing.ModelSpace.AddLine(pt(0), pt(1))
    
    s = Me.TextBox1.Value
    m = Me.TextBox2.Value
    
    Randomize
    num = Int((100 * Rnd) + 1)
    
    k1 = "vigueta" &amp;amp; num
    
    Set b = ThisDrawing.Blocks.Add(pt(0), k1)
    
    i = 0
    While s * i &amp;lt; L.Length
    
        PIL(0) = pt(0)(0) + s * i * Cos(L.Angle): PIL(1) = pt(0)(1) + s * i * Sin(L.Angle)
        PFL(0) = PIL(0) - m * Sin(L.Angle): PFL(1) = PIL(1) + m * Cos(L.Angle)
    
        ThisDrawing.Blocks.Item(k1).AddLine PIL, PFL
    
        i = i + 1
    Wend
    
    Set Bl = ThisDrawing.ModelSpace.InsertBlock(pt(0), k1, 1, 1, 1, 0)
    Bl.Update
    
    L.Delete
    Me.show&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 21 Apr 2023 16:36:58 GMT</pubDate>
    <dc:creator>Ray-Sync</dc:creator>
    <dc:date>2023-04-21T16:36:58Z</dc:date>
    <item>
      <title>Blocks update</title>
      <link>https://forums.autodesk.com/t5/vba-forum/blocks-update/m-p/11913138#M1602</link>
      <description>&lt;P&gt;Hi. I have this code:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim layerObj As AcadLayer
Dim b As AcadBlock
Dim L As AcadLine
Dim pt(1) As Variant
Dim s As Double, m As Double
Dim i As Byte
Dim PIL(0 To 2) As Double, PFL(0 To 2) As Double
Dim num As Integer
Dim k1 As String

Set layerObj = ThisDrawing.Layers.Add("Viguetas")
ThisDrawing.ActiveLayer = layerObj
layerObj.color = acMagenta

Me.Hide
pt(0) = ThisDrawing.Utility.GetPoint(, "Seleccione el punto inicial")
pt(1) = ThisDrawing.Utility.GetPoint(, "Seleccione el punto final")
Set L = ThisDrawing.ModelSpace.AddLine(pt(0), pt(1))

s = Me.TextBox1.Value: m = Me.TextBox2.Value

Randomize
num = Int((100 * Rnd) + 1)

k1 = "vigueta" &amp;amp; num

Set b = ThisDrawing.Blocks.Add(pt(0), k1)

i = 0
While s * i &amp;lt; L.Length

PIL(0) = pt(0)(0) + s * i * Cos(L.Angle): PIL(1) = pt(0)(1) + s * i * Sin(L.Angle)
PFL(0) = PIL(0) - m * Sin(L.Angle): PFL(1) = PIL(1) + m * Cos(L.Angle)

ThisDrawing.Blocks.Item(k1).AddLine PIL, PFL

i = i + 1
Wend

ThisDrawing.ModelSpace.InsertBlock pt(0), k1, 1, 1, 1, 0


L.Delete
Me.show&lt;/LI-CODE&gt;&lt;P&gt;When I run my macro all it´s ok but i see my block after close my USERFORM. I would like to see my block before close my userform. When I create lines called "K" I type K.update then I can see lines before close my userform or when I create splines called "R" I type R.update then I can see my splines before close my userform. Can you help me to see my block before close my userform?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 16:18:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/blocks-update/m-p/11913138#M1602</guid>
      <dc:creator>Ray-Sync</dc:creator>
      <dc:date>2023-04-21T16:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Blocks update</title>
      <link>https://forums.autodesk.com/t5/vba-forum/blocks-update/m-p/11913182#M1603</link>
      <description>&lt;P&gt;This is the solution:&lt;/P&gt;&lt;LI-CODE lang="general"&gt; Dim b As AcadBlock
    Dim L As AcadLine
    Dim pt(1) As Variant
    Dim s As Double, m As Double
    Dim i As Byte
    Dim PIL(0 To 2) As Double, PFL(0 To 2) As Double
    Dim num As Integer
    Dim k1 As String
    Dim Bl As AcadBlockReference
    
    Set layerObj = ThisDrawing.Layers.Add("Viguetas")
    ThisDrawing.ActiveLayer = layerObj
    layerObj.color = acMagenta
    
    Me.Hide
    pt(0) = ThisDrawing.Utility.GetPoint(, "Seleccione el punto inicial")
    pt(1) = ThisDrawing.Utility.GetPoint(, "Seleccione el punto final")
    Set L = ThisDrawing.ModelSpace.AddLine(pt(0), pt(1))
    
    s = Me.TextBox1.Value
    m = Me.TextBox2.Value
    
    Randomize
    num = Int((100 * Rnd) + 1)
    
    k1 = "vigueta" &amp;amp; num
    
    Set b = ThisDrawing.Blocks.Add(pt(0), k1)
    
    i = 0
    While s * i &amp;lt; L.Length
    
        PIL(0) = pt(0)(0) + s * i * Cos(L.Angle): PIL(1) = pt(0)(1) + s * i * Sin(L.Angle)
        PFL(0) = PIL(0) - m * Sin(L.Angle): PFL(1) = PIL(1) + m * Cos(L.Angle)
    
        ThisDrawing.Blocks.Item(k1).AddLine PIL, PFL
    
        i = i + 1
    Wend
    
    Set Bl = ThisDrawing.ModelSpace.InsertBlock(pt(0), k1, 1, 1, 1, 0)
    Bl.Update
    
    L.Delete
    Me.show&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 21 Apr 2023 16:36:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/blocks-update/m-p/11913182#M1603</guid>
      <dc:creator>Ray-Sync</dc:creator>
      <dc:date>2023-04-21T16:36:58Z</dc:date>
    </item>
  </channel>
</rss>

