Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
In the attached file you will find a Rule that rotates an UCS.
The problem I have is that it only rotates once even if I run the rule multiple times.
I really would like to know why? and if there is a way to rotate it more than one time.
Regards
Rikard
Here is the code..
Dim pdoc As PartDocument = ThisDoc.Document Dim pdef As PartComponentDefinition = pdoc.ComponentDefinition Dim otg As TransientGeometry = ThisApplication.TransientGeometry Dim oUCS As UserCoordinateSystem = pdef.UserCoordinateSystems.Item("UCS1") Dim oUCSDef As UserCoordinateSystemDefinition = oUCS.Definition Dim oMatrix As Matrix = otg.CreateMatrix() oMatrix = oUCSDef.Transformation Dim vectest1 As Vector = otg.CreateVector(oMatrix.Cell(1, 2), oMatrix.Cell(2, 2), oMatrix.Cell(3, 2)) oMatrix.SetToRotation(-PI/10, otg.CreateVector(1, 0, 0), otg.CreatePoint(0, 0, 0)) Dim vectest2 As Vector = otg.CreateVector(oMatrix.Cell(1, 2), oMatrix.Cell(2, 2), oMatrix.Cell(3, 2)) MessageBox.Show(vectest1.AngleTo(vectest2), "Test") oUCSDef.Transformation = oMatrix InventorVb.DocumentUpdate()
Solved! Go to Solution.