Dim dbao As AcadCircle
Dim d(0 To 2) As Double
Dim db(0 To 2) As Double
Dim da(0 To 2) As Double
Dim bk As Double
Private Sub batdiem_Click()
Dim batdiem As Variant
UserForm1.Hide
batdiem = ThisDrawing.Utility.GetPoint
x.Text = batdiem(0)
y.Text = batdiem(1)
UserForm1.Show
End Sub
Private Sub batdiem1_Click()
Dim bdiema As Variant
UserForm1.Hide
bdiema = ThisDrawing.Utility.GetPoint
xa.Text = bdiema(0)
ya.Text = bdiema(1)
da(0) = xa.Text
da(1) = ya.Text
UserForm1.Show
End Sub
Private Sub batdiem2_Click()
Dim bdiemb As Variant
UserForm1.Hide
bdiemb = ThisDrawing.Utility.GetPoint
xb.Text = bdiemb(0)
yb.Text = bdiemb(1)
db(0) = xb.Text
db(1) = yb.Text
UserForm1.Show
End Sub
Private Sub laydoixung_Click()
Dim mi As Variant
Dim se As AcadSelectionSet
Set se = ThisDrawing.SelectionSets.Add("k")
Dim en As AcadEntity
UserForm1.Hide
se.SelectOnScreen
For Each en In se
Set mi = en.Mirror(da, db)
Next en
se.Clear
se.Delete
Application.Update
UserForm1.Show
End Sub
Private Sub vehinh_Click()
d(0) = x.Text
d(1) = y.Text
bk = r.Text
Set dbao = ThisDrawing.ModelSpace.AddCircle(d, bk)
dbao.color = acRed
Dim a As Variant
a = dbao.Offset(-t.Text)
dbao.color = acGreen
Dim mt As AcadText
Dim dc(0 To 2) As Double
dc(0) = d(0) - r / 2
dc(1) = d(1) + r * 1.2
Dim ya As String
ya = "MAT CAT"
Set mt = ThisDrawing.ModelSpace.AddText(ya, dc, r / 6)
mt.Update
dbao.Update
ZoomAll
End Sub
Bạn đang đọc truyện trên: Truyen2U.Pro