# Formulas in Fields

## Recommended Posts

Hi all, I have been tasked with coming up with a dynamic block that is for a chute.

It is a simple rectangle that I've added some attributes to and a field within one of the attributes. What I need the formula to do is calculate the angle of the chute based on user input for the upper height and the lower height (rise) and "Distance 1" (run) and then return the answer in the field.

It returns the correct angle on insertion, however, when I change any of the values and Regen the result is incorrect.

In addition, I would like the "Angle" attribute to not show in the dialog box when inserted. Is that possible?

Thanks.

Chute plan view.dwg

##### Share on other sites

Ok so what formula are you using because your trying to find an angle using x and y coordinates. This would be a trigonometric function which you can't do with a formula in AutoCAD. If you look at the formulas you can use they are limited to average, sum, count, and cell. Just the basic add, subtract, multiply, and divide. If look at the Auto Desk Exchange there is a app you can get that will give you those features to do SIN COS and TAN but you have to pay for it and it's not cheap. What you could do is find the cos by dividing the y value by the hypotenuse which is just simple math then you could use the law of cosines to solve for the angle. it will take a lot of work but doable I think. You might be better off looking into using a lookup instead of a attribute.

##### Share on other sites

I was finally able to get it to work. Not sure what I did to correct the issue. I just started over from scratch. It looks the same as what I had. I may have selected "none" this time for units in the formula.

Attached is the working block.

Thanks

Chute plan view.dwg

##### Share on other sites

I cant get it to work what am I doing wrong. I didn't realize AutoCAD supported all those other functions. Kinda nice to know.

##### Share on other sites

Did you "Regen" after changing the values or stretching? Also, make sure your units are inches and that you are in "Architectural" mode.

##### Share on other sites

Ok I got it to work. I was thinking that the angle was wrong but then remembered it's rise over distance that defines the angle not the distance of the rise if that makes sense. It took a few tries to get it to work but I works like you said.

##### Share on other sites

Good, I'm glad you got it to work. I was starting to worry I still had something wrong!

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.