Text Note - baseDirection Weird Number

Text Note - baseDirection Weird Number

Julian.Wandzilak
Advocate Advocate
642 Views
3 Replies
Message 1 of 4

Text Note - baseDirection Weird Number

Julian.Wandzilak
Advocate
Advocate

I was playing recently with text notes and was rotating them a little bit. One thing I need some help with/clarification. 

 

BaseDirection - Revit Lookup shows values between -1 and 1. I was hoping to use it to make sure that text notes are horizontal or vertical. The thing is that it didn't worked. 

 

So please find below the printscreent:

 

base Direction.png

 

To achieve it I manually rotated the textNote 90 degree with its handle - Lookup is showing correctly 0, 1, 0 - but when I collected it and check it with my code I end up with this weird number which is visible on the form. 

 

TaskDialog.Show("TEST", $"TEXT NOTE ID: {textNote.Id} \n BASE DIRECTION X : {textNote.BaseDirection.X} \n, BASE DIRECTION Y : {textNote.BaseDirection.Y} \n  BASE DIRECTION Z : {textNote.BaseDirection.Z} \n ");

 

 

blog: w7k.pl more about me: Linkedin Profile
My add-ins for Revit: Drafter(180+ scripts) & Leveler
0 Likes
Accepted solutions (1)
643 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni
Accepted solution

Dear Julian, 

  

There is nothing strange about that at all.

  

On a digital computer working with real numbers represented as doubles or floats, 

2.77555756156289E-17 is exactly the same thing as 0.0.

  

Please read up on precision and the need for fuzz:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 4

Julian.Wandzilak
Advocate
Advocate
Thanks! Sometimes I need someone to point to me things which should be obvious 😉
blog: w7k.pl more about me: Linkedin Profile
My add-ins for Revit: Drafter(180+ scripts) & Leveler
0 Likes
Message 4 of 4

jeremy_tammik
Alumni
Alumni

Me too! Happy weekend.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes