Get BlockReference angle value

Get BlockReference angle value

mcoH3VZV
Advocate Advocate
991 Views
1 Reply
Message 1 of 2

Get BlockReference angle value

mcoH3VZV
Advocate
Advocate

Hi,

 

On a drawing, I have a bunch of blocks inserted, and when I click on them, under the misc properties, Rotation is either 270.00, 0.00, or 90.00. I need to extract this information.  However, when I use BlockReference.Rotation for a block that has 270.00 for the mic property Rotation, I get 4.1 or something. Am I doing something wrong here, does it need to be converted, or read to a specific Data Type?

 

Thanks,

0 Likes
Accepted solutions (1)
992 Views
1 Reply
Reply (1)
Message 2 of 2

Alexander.Rivilis
Mentor
Mentor
Accepted solution

@mcoH3VZV wrote:

Hi,

 

On a drawing, I have a bunch of blocks inserted, and when I click on them, under the misc properties, Rotation is either 270.00, 0.00, or 90.00. I need to extract this information.  However, when I use BlockReference.Rotation for a block that has 270.00 for the mic property Rotation, I get 4.1 or something. Am I doing something wrong here, does it need to be converted, or read to a specific Data Type?

 

Thanks,


BlockReference.Rotation return angle value in Radians. So you have to translate from Radians to Degrees:

using System;

public static double ConvertRadiansToDegrees(double radians)
{
    double degrees = (180 / Math.PI) * radians;
    return (degrees);
}

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member