Calculate difference between 2 values (Formula)

Calculate difference between 2 values (Formula)

Anonymous
Not applicable
876 Views
4 Replies
Message 1 of 5

Calculate difference between 2 values (Formula)

Anonymous
Not applicable

Is there a way to tell AutoCAD to show the difference between 2 values?

 

I've a block that shows the slope between 2 floor levels, those levels can be + or -.

Is there any way to show the distance between those numbers?

 

-X +Y

-X -Y

+X -Y

+X +Y

 

In Excel I'd use the formula IF((X-Y)<=0,Y-X,X-Y), but i'm not sure how to add this in a FIELD

 

In these 

0 Likes
Accepted solutions (2)
877 Views
4 Replies
Replies (4)
Message 2 of 5

imadHabash
Mentor
Mentor

Hi,

>> but i'm not sure how to add this in a FIELD

you may try this one . >> Click <<

 

Regards,

Imad Habash

EESignature

0 Likes
Message 3 of 5

j.palmeL29YX
Mentor
Mentor
Accepted solution

Where are the both values coming from?

Maybe  abs(x-y)  will help you?

 

cadder

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 4 of 5

Kent1Cooper
Consultant
Consultant
Accepted solution

@j.palmeL29YX wrote:

....

Maybe  abs(x-y)  will help you?

....


That is, in proper AutoLisp format:  (abs (- x y))

Kent Cooper, AIA
0 Likes
Message 5 of 5

Anonymous
Not applicable

You guys are the best!!!!

 

Worked as intended. Thanks you!!

 

Edit: The final formula is: ((abs(X-Y))/Length)*100

 

0 Likes