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.
Solved! Go to Solution.
Solved by joantopo. Go to Solution.
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
Ok.
And the origin direction, what is it in API for angles? Direction West in clockwise?
Thanks for your answer.
You need to examine system variables "ANGBASE" and "ANGDIR".
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!
Can't find what you're looking for? Ask the community or share your knowledge.