.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mtext.rotation, always in radians?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
joantopo
766 Views, 4 Replies

mtext.rotation, always in radians?

Hi.

I am creating new mtext and I have to define the rotation properly for each one.

 

Which units is for rotation property?

 

I think that it is in radians.

 

Can I convert gradians to radians (with my conversor function) if some gradians is negative?

Or it must be from 0 to 400g to convert to radian?

 

If I change units drawing from Autocad or programming, I get always the same rotation in the drawing.

 

int intAUnit = db.Aunits;    

                //sentido horario
bool intAngDir = db.Angdir;   // si es true está activado el sentido horario.

double angulo = db.Angbase;  //para indicar si es al este ,oeste,norte,etc..

 

Thanks.

 

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
4 REPLIES 4
Message 2 of 5
hgasty1001
in reply to: joantopo

Hi,

 

To my knowledge, all angular information in the Autocad .NET API use radians, and all rotations are specified in radians, no matter the units settings in Autocad, a program must use radians in the code.

 

Gaston Nunez

 

 

Message 3 of 5
joantopo
in reply to: hgasty1001

Ok.

 

And the origin direction, what is it in API for angles?  Direction West in clockwise?

 

Thanks for your answer.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Message 4 of 5
norman.yuan
in reply to: joantopo

You need to examine system variables "ANGBASE" and "ANGDIR".

Norman Yuan

Drive CAD With Code

EESignature

Message 5 of 5
joantopo
in reply to: norman.yuan

OK.

 

I copy both system vars in my own vars.

 

  
                 SentidoHorario = db.Angdir; //clockwise
                  direccionAngular = db.Angbase; //angle direction


SentidoHorario = false; 
                  direccionAngular = System.Math.PI / 2;  

                  double orientaciónTexto =0;    //in radians
                  if (checkBox_TextoOrientado.Checked == true)
                  {
                  orientaciónTexto = Math.PI / 2 - OPERACIONES.Operacions.gradrad(acimutAlin);
                  }

 

 and before of ending, return the values of vars:

 

     db.Angdir = SentidoHorario;
              db.Angbase = direccionAngular;

P.S: acimutAlin is in gradian degrees, so I convert them to radians. "AcimutAlin" is from North Azimuth.  (oriented text will be orthogonal from azimut)

 

Thanks guys!

 

 

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost