How to rotate set of objects along an axis in AutoCAD?

How to rotate set of objects along an axis in AutoCAD?

jlobo2
Advocate Advocate
1,056 Views
6 Replies
Message 1 of 7

How to rotate set of objects along an axis in AutoCAD?

jlobo2
Advocate
Advocate

We are implementing an application, where we are drawing objects, representing a panel, which represents the columns of the wall. I need to rotate the set of objects (the columns) together on one axis.

 

How do I achieve it?

 

FFOfWall.jpg

Expected ResultExpected Result

 

 

I have the following code, but it's for rotating each objects.

            using (Transaction acTrans = dwgDb.TransactionManager.StartTransaction())
            {
                // Access drawing block table
                pBlockTbl = acTrans.GetObject(dwgDb.BlockTableId, OpenMode.ForWrite) as BlockTable;

                pBlockRef = (BlockReference)acTrans.GetObject(thePANBLKBlockReference, OpenMode.ForWrite);
                pBlockRef.ColorIndex = colorIndex;

                Point3d tempPoint = pBlockRef.Position;

                Matrix3d curUCSMatrix = acDoc.Editor.CurrentUserCoordinateSystem;
                CoordinateSystem3d curUCS = curUCSMatrix.CoordinateSystem3d;

                // Rotate the polyline 45 degrees, around the Z-axis of the current UCS
                pBlockRef.TransformBy(Matrix3d.Rotation(0.7854,
                                                     curUCS.Yaxis,
                                                     tempPoint)); 


                acTrans.Commit();
            }

 

0 Likes
Accepted solutions (1)
1,057 Views
6 Replies
Replies (6)
Message 2 of 7

Alexander.Rivilis
Mentor
Mentor
Accepted solution

You have to set single tempPoint to the value of base point of rotation. It is not a Position of BlockReference in your case.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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

0 Likes
Message 3 of 7

Alexander.Rivilis
Mentor
Mentor

By the way, why this topic was created in this forum ??? This is not the first time you selected wrong forum.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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

0 Likes
Message 4 of 7

jlobo2
Advocate
Advocate

Got the Output. Thank you @Alexander.Rivilis 

Sorry about the forum. Which forum should I use for posting these questions?

0 Likes
Message 5 of 7

Alexander.Rivilis
Mentor
Mentor

@jlobo2 wrote:

Got the Output. Thank you @Alexander.Rivilis 

Sorry about the forum. Which forum should I use for posting these questions?


You should posting such questions to .NET forum: https://forums.autodesk.com/t5/net/bd-p/152

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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

Message 6 of 7

Alexander.Rivilis
Mentor
Mentor

@jlobo2 wrote:

Got the Output. Thank you @Alexander.Rivilis 

Problem was solved now?

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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

0 Likes
Message 7 of 7

jlobo2
Advocate
Advocate

Yes @Alexander.Rivilis  Thank You once again.

I will be mindful of posting such questions in the .NET forum henceforth.

 

RotationOP.jpg