Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. Public vKula1 As Integer
  2.  
  3. Private Sub buttOK_Click()
  4. Dim miejsce As String
  5. UserForm1.buttOK.Cancel = True
  6. Dim str As String
  7. vKula1 = UserForm1.v1Kula1
  8. Dim r As Double
  9. Dim x As Double
  10. Dim y As Double
  11. Dim z As Double
  12.  
  13. UserForm1.Hide
  14. Dim Pl1(0 To 2) As Double
  15. Dim Pl2(0 To 2) As Double
  16. miejsce = "Wskaż miejsce uderzenia na drugiej kuli"
  17. MsgBox miejsce
  18. With ThisDrawing.Utility
  19. point = .GetPoint
  20. End With
  21. Dim LiniaWiodaca1 As AcadLine
  22. Dim point2(2) As Double
  23. Pl2(0) = point(0)
  24. Pl2(1) = point(1)
  25.  
  26. Dim ModelSpace As AcadModelSpace
  27. Set ModelSpace = ActiveDocument.ModelSpace
  28. For Each obj In ModelSpace
  29. str = obj.ObjectName
  30. If "AcDbCircle" = obj.ObjectName Then
  31. Set cir = obj
  32. If cir.Layer = "Kula2" Then
  33.  
  34. Set LiniaWiodaca1 = ThisDrawing.ModelSpace.AddLine(cir.Center, Pl2)
  35. x = cir.Center(0) - point(0)
  36. y = cir.Center(1) - point(1)
  37. z = cir.Center(2) - point(2)
  38.  
  39. r = Sqr((Sqr((x ^ 2) + (y ^ 2)) ^ 2) + (z ^ 2))
  40.  
  41.  
  42.  
  43. 'Set tempSolid = bryla1.CheckInterference(bryla2, True, bSolidsInterfere)
  44.  
  45.  
  46. End If
  47. End If
  48. Next
  49. For Each obj In ModelSpace
  50. str = obj.ObjectName
  51. If "AcDbCircle" = obj.ObjectName Then
  52. Set cir = obj
  53. If cir.Layer = "Kula1" Then
  54.  
  55.  
  56. cir.Move cir.Center, point
  57.  
  58. cir.Update
  59. 'Set tempSolid = bryla1.CheckInterference(bryla2, True, bSolidsInterfere)
  60.  
  61.  
  62. End If
  63. End If
  64. Next
  65.  
  66.  
  67.  
  68.  
  69. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement