Revit API

Reply
Active Contributor
nitinjambhale
Posts: 43
Registered: ‎04-21-2011
Message 1 of 4 (339 Views)
Accepted Solution

Rotation in slope

339 Views, 3 Replies
09-05-2012 12:31 AM

Hello friends,

I m struggling to rotate a family in slope.

Please help.

 

Thanks.

-Nitin.

 

 

 

Hi Nitin,

 

Here is a sample showing how to rotate an element.  

 

public void RotateColumn(Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.Element element)
{
XYZ point1 = new XYZ(10, 20, 0);
XYZ point2 = new XYZ(10, 20, 30);
// The axis should be a bound line.
Line axis = document.Application.Create.NewLineBound(point1, point2);
ElementTransformUtils.RotateElement(document, element.Id, axis, Math.PI / 3.0);
}

 

What's problem when rotate the sloped family? Please give more detailed information about what kind of element?   It is better to upload a very simple model to explain how to you want to rotate it. 

 

BTW, if you just want to rotate a sloped column, you can change the column's "Cross-Section Rotation"  parameter value to rotate the column.

 

HI joe

Thanks for the reply. Its working now. There was some misunderstanding.

Thanks.

 

-Nitin

Contributor
manishsingh12jan
Posts: 15
Registered: ‎09-05-2012
Message 2 of 4 (329 Views)

Rotation in slope

09-05-2012 12:42 AM in reply to: nitinjambhale

Dear Friend,

 

I am manish i am facing same problem in rotation of families.

 

while i am using

 

ElementTransformUtils.RotateElementDocument,Family Id, axis, Rotation Angle);

 

I am not Getting that

 

1. How to calculate Axis.

2. Rotation angle.

 

 

ADN Support Specialist
Joe.Ye
Posts: 334
Registered: ‎03-05-2010
Message 3 of 4 (313 Views)

Re: Rotation in slope

09-06-2012 02:36 AM in reply to: nitinjambhale

 

 

Hi Nitin,

 

Here is a sample showing how to rotate an element.  

 

public void RotateColumn(Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.Element element)
{
    XYZ point1 = new XYZ(10, 20, 0);
    XYZ point2 = new XYZ(10, 20, 30);
    // The axis should be a bound line.
    Line axis = document.Application.Create.NewLineBound(point1, point2);
    ElementTransformUtils.RotateElement(document, element.Id, axis, Math.PI / 3.0);
}

 

What's problem when rotate the sloped family? Please give more detailed information about what kind of element?   It is better to upload a very simple model to explain how to you want to rotate it. 

 

BTW, if you just want to rotate a sloped column, you can change the column's "Cross-Section Rotation"  parameter value to rotate the column.

 



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
Active Contributor
nitinjambhale
Posts: 43
Registered: ‎04-21-2011
Message 4 of 4 (271 Views)

Re: Rotation in slope

10-01-2012 09:52 PM in reply to: Joe.Ye

HI joe

Thanks for the reply. Its working now. There was some misunderstanding.

Thanks.

 

-Nitin

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.