I want the result of the field to be rounded up, but I have tried using some functions but have not been successful. I cannot find any information on the format processing of the field results in AutoCAD. I hope that AutoCAD experts can help solve this problem. Sincere thanks!
Ceil is not an available function in fields.
Try round((10+6+13+8+2)/24+0.5)
Adding the 0.5 makes the round function ino a ceil function.
See also https://www.cadforum.cz/en/qaID.asp?tip=6381
Your method is rounding, if it is greater than or equal to 1.5, the result will be calculated as 2, and if it is less than 1.5, the result will be 1. And my expectation is to round up. When the number of decimal places is less than 0.5, such as 1.4, my expected method will calculate the result as "2". For example, "1.3" will also be rounded up to "2", for example, "1.2" will also be rounded up to "2", for example, "1.1" will also be rounded up to "2", and for example, "1.01" will also be rounded up to "2". I hope you can understand my requirements. Thank you
I assume your formula is meant to determine something like how many 24 unit lengths are needed to make the individual lengths you're adding up.
I was thinking maybe Diesel would work with the "fix" function, which truncates a real number to an integer by removing the fractional (decimal) part, as long as we add 1 before doing so.
Of course, you will have to test this with your numbers...
(I'm afraid it will result in a number that is +1 too high when the result of the division is a whole number - has no fraction to truncate.)
Hi @2299934
Do you run AutoCAD Map3? Or Civil3D? Or Arc Pro?
You can use CEIL in an expression when connected to DATA such as shapefile or Gdb.
Plain vanilla AutoCAD does not recognize the term CEIL when you put it in a Field.
If you want to work with Fields while using plain vanilla Cad, then try using ROUND instead. You can use ROUND with 0.4999999999.
Like this:
Chicagolooper
Hello! Let me explain to every experts again why this calculation is necessary. Please refer to the left “System-Drawing”. There is a network facility called "24 port network distribution frame", which is used to connect the network. It only has 24 interfaces. If there are more than 24 network cables connected, such as 25, then two 24 port distribution frames need to be installed on the cabinet. If there are only 24 network cables, then only one 24 port network distribution frame needs to be installed on the cabinet. Therefore, in the process of network engineering construction, it is necessary to count how many network cables are connected from the front end to the Network Room. If there are 39 network cables, 39/24=1.625=2, then "Two" 24 port network distribution frames are required.
If there are exactly 48 network cables, then 48/24 = 2 = 2, then "Two" 24 port network distribution frames are required.
If there are 49 network cables, 49/24 ≈ 2.04 = 3, then "Three" 24 port network distribution frames are required.
The above methods, round (X/24)+0.5) or+(0.49), cannot achieve this calculation effect, Only operation methods like the "Ceil" function can achieve such effects. However, unfortunately you told me that the "Fields" in AutoCAD do not support the operation of the ceil function. I hope the next version of AutoCAD can support the operation of the "ceil" function to solution this calculate situation
@2299934 wrote:Your method is rounding, if it is greater than or equal to 1.5, the result will be calculated as 2, and if it is less than 1.5, the result will be 1. And my expectation is to round up. When the number of decimal places is less than 0.5, such as 1.4, my expected method will calculate the result as "2". For example, "1.3" will also be rounded up to "2", for example, "1.2" will also be rounded up to "2", for example, "1.1" will also be rounded up to "2", and for example, "1.01" will also be rounded up to "2". I hope you can understand my requirements. Thank you
@2299934 :If you are replying to me instead to @ChicagoLooper, please read my reply more closely. I am not suggesting just rounding. The CEIL (X) function, which you are aware of but which isn't available in fields IS THE SAME AS ROUND (X+0.5) if your intent is to get an integer result.
To ensure we know who you are replying to, please use the browser interface , hit the reply button in the post you are replying to and identify who you are replying to in the message itself.
Hi @2299934
The image you uploaded in Post#1 indicates you are using COUNT to determine the number of distribution frames. You should use FORMULA instead.
You can get the number you want but you need to create a Formula with the ROUND function. You'll also need to include the '+' sign and the decimal number 0.499999999 to this formula.
Using your uploaded image in Post #7, you provide three (3) examples. Each example describes a different Front End. The number of Distribution Frames needed in each example depends on the number of Front End cables. Correct?
a) If 39 cables from front end....then you need 2 Distribution Frames
b) If 48 cables from front end....then you need 2 Distribution Frames
c) If 49 cables from front end....then you need 3 Distribution Frames
The FORMULAS for each individual condition would look like this:
a) (ROUND (10.0000+6.0000+13.0000+8.0000+2.0000)/24)+ 0.499999999
b) (ROUND (10.0000+6.0000+13.0000+8.0000+11)/24)+ 0.499999999
c) (ROUND (10.0000+6.0000+13.0000+8.0000+12)/24)+ 0.499999999
Notes:
Chicagolooper
Can't find what you're looking for? Ask the community or share your knowledge.