Rotate coordinate system? transform?...

Rotate coordinate system? transform?...

Anonymous
Not applicable
1,251 Views
1 Reply
Message 1 of 2

Rotate coordinate system? transform?...

Anonymous
Not applicable

Hello everybody,

I am developing a tool to place lighting fixtures from a text document comming from a lighting calculation software (Dialux).

Each group of elements in a room is given as a "structure". the information obtained of the structure is the next:

Structure location (lower-left element location)

Structure rotation

number of fixtures (in X and Y)

distance between fixtures (in X and Y)

structure.jpg

I am happy when creating structures witout rotation, but when I have to apply rotation I do not know how to rotate the coordinates system in its Z axis.

I have read something about the Transform. I tyed to create a transform with a rotation

Transform tra = Transform.CreateRotation(XYZ.BasisZ,45);

But I am not sure if it is correct and I do not know how do i have to follow.... I am completly block.

 

I am so sorry if my question is stupid, I am very new in Revit API....

 

 

Any help is welcome!!!

 

Many thanks in advance

0 Likes
1,252 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
In order to compute the transformed coordinates of the new fixtures, you'll need to perform two transforms, one translates the point, the other rotates the point about another point. (so instead of using the createRotation, you'll createRotationAtAPoint giving it the structure origin)
in pseudoCode;
translateTransform = createTranslation(vector to structure origin)
rotateTransform = createRotationAtPoint( pass in structure origin)

XYZ FixtureLocationInLocalSystem;
xyz newFixturePoint = rotateTransform.OfPoint(translateTransform.OfPoint(FixtureLocationInLocalSystem));

Then you'll need to use a family placement override that takes a direction and pass it the direction of the lighting structure.
0 Likes