resullins Posted May 19, 2020 Posted May 19, 2020 I have a block with a field as an attribute that's multiplying two other attributes. It always multiplies to a whole number, but the precision is set to two decimal places. I can not seem to find out how to fix this. It's staring right at me in the Field Expression, but as far as I know, this isn't editable. Any help? Quote
BIGAL Posted May 20, 2020 Posted May 20, 2020 Can not see the atts are they a integer no decimals may explain ? Post a dwg. Quote
steven-g Posted May 20, 2020 Posted May 20, 2020 As far as I know fields use the system precision 'units'. But what are the properties you have used for the fields in the formula, I would expect to see a number there for the value and not the Tag of an attribute (ie. the field property should be 'value'). Can you post a copy of the block? or show us the field dialogue for one of the fields from the formula. There are no details showing inside the 'Format' section you should be able to choose between decimal, architectural, etc. and be able to set the precision from there independantly. Quote
Dadgad Posted May 20, 2020 Posted May 20, 2020 (edited) 1 hour ago, steven-g said: As far as I know fields use the system precision 'units'. But what are the properties you have used for the fields in the formula, I would expect to see a number there for the value and not the Tag of an attribute (ie. the field property should be 'value'). Can you post a copy of the block? or show us the field dialogue for one of the fields from the formula. There are no details showing inside the 'Format' section you should be able to choose between decimal, architectural, etc. and be able to set the precision from there independantly. That sounds about right, like you would be able to, if it were a cell in a Table. Edited May 20, 2020 by Dadgad graphic Quote
resullins Posted May 20, 2020 Author Posted May 20, 2020 Here's the block file. @steven-g There are no values because it's multiplying two other fields, which are defined from other attributes. And I tried updated the UNIT precision, nothing. @Dadgad That's what everyone keeps pointing to, the properties. But because I have to open the attribute editor first, there's no way to get to the properties by the time I select the field, if that makes sense. _PM SPEAKER-BLOCK.dwg Quote
steven-g Posted May 21, 2020 Posted May 21, 2020 It's been a long time since I did anything with blocks, and trying to remember all the ins and outs. To get an attribute field formula to read other attributes does require a trick and some rules 1) the 'total' attribute has to have the property 'preset' =yes so that it doesn't prompt for a value on insertion and overwrite the field 2) when inserting the fields the tickbox in the attribute editor for 'use block value' has to be ticked 3) and this is the trick - the block has to have a dynamic action carried out once inserted to make it an annonymous block so that the formula will read the values in that block rather than from the block definition, the easiest way is to use a visibility state and hide the total attribute for the state that is used on insert. In your block you already have a visibility state with 'OFF' being the default so the total attribute needs to be hiden for that state but visible to all the others, I just added a new visibility state 'Total' When you first insert the block fill in your values then change the visibility state to one of the other values and do a regen so that the fields can update. As for the precision once you have added the 'two fields in the formula press the 'evaluate' button and you should then get the chance to select decimal and adjust the precision. _PM SPEAKER-BLOCK.dwg 1 Quote
Dadgad Posted May 21, 2020 Posted May 21, 2020 @steven-g Damn, I had just seen this and was eager to download the block and play around with it, certainly sounds like you've got a real good handle on the situation! I have had good luck setting up some pretty tricky AutoCAD tables, back in the day, before we switched to ProSteel, which does that sort of stuff in the background, but no experience with something like this. Well done! Quote
steven-g Posted May 21, 2020 Posted May 21, 2020 @Dadgad Thanks, it's been about 4 years since I did anything serious with blocks, the last company I worked for we only did takeoffs from drawings so there was no need to 'create' any content which makes you a bit rusty. I just hope it helps @resullins problem. Quote
resullins Posted May 21, 2020 Author Posted May 21, 2020 @steven-g 1. I'll change the PRESET property for that attribute. We just don't tend to overwrite it. We're a small firm with few engineers... but that will be helpful, thanks. 2. I'm not sure what this is or what it will do? I don't even know where to find this tick box? 3. We always just REGEN when we're all done. Quickest way to get everything to re-read. And What does the TOTAL VS do? We already have OFF where the total attribute is hidden, and it's visible in all the other VS... so I'm confused on this one? The EVALUATE button doesn't change anything. Quote
steven-g Posted May 21, 2020 Posted May 21, 2020 2. 3. The total visibility state is only there because I didn't know wether you always switch to a visibility state once the block is inserted, and 'total' just keeps the same visual settings as 'OFF' but the important point is you MUST make a dynamic alteration to the block once inserted before the 'total' attribute will work, if you always select a different visibility state then ther is indeed no need for 'total' Quote
resullins Posted May 21, 2020 Author Posted May 21, 2020 That box is definitely ticked. And thanks for the visual... I haven't had enough coffee this morning, so that helped. Quote
Seneca Posted October 18 Posted October 18 The field expression can be copied out to notepad. Change the 2 to whichever precision you want. Copy that new field expression and paste into your attribute instead. That becomes the field with the desired precision. Quote
Recommended Posts
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.