Message 1 of 2
Blocks update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi. I have this code:
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" & num
Set b = ThisDrawing.Blocks.Add(pt(0), k1)
i = 0
While s * i < 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.showWhen 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?
jefferson