Piotr Włoszyński

Piotr Włoszyński LAPLASIAN wszystko
rozwiąże

Temat: kąt obrotu prostopadłościanu (VBA)

witam,
nie mogę sobie poradzić ze znalezieniem kąta obrotu prostopadłościanu na rysunku, w sumie interesuje mnie kąt na płaszczyźnie XY.

Sub PobierzKąt()
Dim Licznik As Integer
Dim oEnumerator As ElementEnumerator
Dim oElement As Element

Set oEnumerator = ActiveModelReference.GetSelectedElements
Licznik = 0
Do While oEnumerator.MoveNext
Set oElement = oEnumerator.Current
Licznik = Licznik + 1
Loop
If Licznik = 1 Then
Dim Punkty() As Point3d
Punkty = oElement.AsSmartSolidElement.GetVertices
' i tutaj chciałem mierzyć kąt pomiędzy punktami 1 i 2 ale nie idzie ....
Else
MsgBox ("Wybierz jeden element")
'ActiveModelReference.UnselectAllElements
End If

End Sub

Coś w ogóle szwankuje z AsSmartSolidElement i isSmartSolidElement, bo wstawiam bryłę funkcją
Dim slab1 As SmartSolidElement
Set slab1 = SmartSolid.CreateSlab(Nothing, 10, 20, 30)
i tej wstawionej bryły nie widzi już jako SmartSolid ...