' Set a reference to the assembly component definintion. Dim oAsmCompDef As AssemblyComponentDefinition Set oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
' Get an occurrence from the select set. On Error Resume Next Dim oOccurrence As ComponentOccurrence Set oOccurrence = ThisApplication.ActiveDocument.SelectSet.Item(1) If Err Then MsgBox "An occurrence must be selected." Exit Sub End If On Error GoTo 0
' Get the current transformation matrix from the occurrence. Dim oTransform As Matrix Set oTransform = oOccurrence.Transformation
Dim oOrigin As Point Dim oXAxis As Vector Dim oYAxis As Vector Dim oZAxis As Vector Call oTransform.GetCoordinateSystem(oOrigin, oXAxis, oYAxis, oZAxis)
'now, get back the rotation angle about the above specified rotation vector (from the matrix) Dim oTG As TransientGeometry Set oTG = ThisApplication.TransientGeometry
Dim vZ As Vector Dim vX As Vector Dim vY As Vector
Set vZ = oTG.CreateVector(0, 0, 1) Set vX = oTG.CreateVector(1, 0, 0) Set vY = oTG.CreateVector(0, 1, 0)
Пост N: 329
Откуда: Россия, Московская область
Рейтинг:
0
Отправлено: 09.10.07 11:00. Заголовок: Re:
Ab Спасибо. Такого примера в хелпе 11-го я не нашел. Если я правильно понял, то чтоб определить угол вращения вокруг оси Z надо найти угол поворота вектора oXAxis относительно вектора vX?
Все даты в формате GMT
3 час. Хитов сегодня: 2
Права: смайлы да, картинки да, шрифты да, голосования нет
аватары да, автозамена ссылок вкл, премодерация вкл, правка нет