Formula for Adding +1 to Numerical Attribute

Formula for Adding +1 to Numerical Attribute

bret_wieseler
Enthusiast Enthusiast
3,462 Views
20 Replies
Message 1 of 21

Formula for Adding +1 to Numerical Attribute

bret_wieseler
Enthusiast
Enthusiast

Is there a way, using fields and diesel expressions, to assign a numerical value to an attribute definition, and then having fields that are +1, +2, +3, etc. the attribute?

 

Does that make sense?

 

Thanks in advance.



iMac | 3.6 GHz 8-Core Intel Core i9 | 64 GB | Sequoia 15.5 | Autocad LT for Mac - 2024.2
0 Likes
Accepted solutions (1)
3,463 Views
20 Replies
Replies (20)
Message 2 of 21

maxim_k
Consultant
Consultant
Hi Bret,

You can use formulas in FIELDS and you can calculate values with DIESEL, but in AutoCAD for Mac FIELDS have limited functionality.

Can you describe in more details how do you want to use requested? Step by step - what do you want to achieve.

Maxim

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 3 of 21

bret_wieseler
Enthusiast
Enthusiast

 

elevation.jpg

For landscape architectural elevations, I want to have a vertical ruler along the side where I can enter the base elevation and the numbers self-populate with the proper heights.



iMac | 3.6 GHz 8-Core Intel Core i9 | 64 GB | Sequoia 15.5 | Autocad LT for Mac - 2024.2
0 Likes
Message 4 of 21

maxim_k
Consultant
Consultant
Accepted solution

Do you need something like in attached drawing?

If yes, I'v afraid it is not possible to create such block in AutoCAD for Mac, because of its FIELDs functionality limitations.

I created this block in AutoCAD for Windows.

 

Maxim


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 5 of 21

bret_wieseler
Enthusiast
Enthusiast

That's exactly what I need!  Thanks for the effort.

 



iMac | 3.6 GHz 8-Core Intel Core i9 | 64 GB | Sequoia 15.5 | Autocad LT for Mac - 2024.2
0 Likes
Message 6 of 21

Anonymous
Not applicable

Hello Maxim, 

 

I came across this post on my search for a solution, which - I'm afraid - is not available in AutoCAD for Mac. But maybe you could help me out here too... 

 

I have a dynamic block with three attributes, a CURRENTLEVEL, NEWLEVEL and RESULT. 

I'm trying to get it done that RESULT = NEWLEVEL-CURRENTLEVEL, but I cannot get the correct fields in the formula. When I want to insert the fields into the Formula dialog (normally a right-click), I do not have this option. 

 

Could you indicate me the procedure please? Is there another way maybe? 

 

Thanks in advance! 

0 Likes
Message 7 of 21

maxim_k
Consultant
Consultant
Hi Marnix,

Can you attach your block here?
I'll look at it.

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 8 of 21

Anonymous
Not applicable

Wonderful. Thank you in advance. I'm curious about what I'm doing wrong. 

 

The file should be added below. 

0 Likes
Message 9 of 21

maxim_k
Consultant
Consultant
I managed to create what you need, but looks like in AutoCAD 2016 for Mac (which you are using) field calculations inside block don't work, maybe because of some bug.
I tried my version of block in AutoCAD 2018 for Mac and it seems to work.

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 10 of 21

Anonymous
Not applicable

How wonderful Maxim, that you managed to create the block. 

It is a pity that my AutoCAD for Mac is not having this possibility, which is indeed the 2016. 

 

Do you mind sharing your version of the block? 

0 Likes
Message 11 of 21

maxim_k
Consultant
Consultant

Sorry for delay - it was weekend plus I had to recreate your block myself, as block in your drawing sometimes behaves in a strange manner in AutoCAD for Mac.

 

Anyway, in the attached drawings you can find two versions of your block (both of them works fine in AC 2018, but don't work in AC 2016):

- in the "grondverzet-000.dwg" there is "grondverzet" block, which I created with this method. You can copy already inserted block and change CURRENTLEVEL and NEWLEVEL attributes values, after REGEN the RESULT attribute updates automatically. But if you will insert block with INSERT command, you will be able to make it work only after you create new Formula field for RESULT attribute (which is impossible in AutoCAD for Mac)

- in the "grondverzet-0000.dwg" there is "grondverzet-1" block, which I created with another method. You can use INSERT command to insert block to the drawing area and it will start to work after you will change scale of the block with dynamic grip (this method uses "dynamic block" trick to force RESULT attribute to start working properly, an your block, fortunately, already has dynamic set).

 

As I wrote before both blocks work in 2018 version and not in 2016 version. Plus if you will try to edit Formula field in RESULT attribute in AutoCAD for Mac, the blocks will loose their functionality.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 12 of 21

Anonymous
Not applicable

Thank you for your extended reply Maxim, 

 

It's a pity that I cannot use your blocks because of some bug (or other malfunction) in Acad2016. I'm not planning on upgrading anytime soon, so I think I'll just have to deal with the fact that I have a good drawingprogram, but that I need to do these calculations in Excel. 

 

Do I understand well that you have a Parrallels running with Acad for Windows to avoid this kind of things? 

Actually that is pretty ****ty in my opinion, but nothing you could solve. 

 

So thanks again for your effort and patience! 

A good day and 'till next time maybe. 

 

Marnix

0 Likes
Message 13 of 21

maxim_k
Consultant
Consultant

>>>>Do I understand well that you have a Parrallels running with Acad for Windows to avoid this kind of things?

Yes, I am using AutoCAD for both platforms. And yes - I'm running Windows in Parallels virtual machine.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 14 of 21

maxim_k
Consultant
Consultant

Marnix,

 

I have another idea.

Can you try to play with attached block "concept" in AC2016 for Mac?

- Open attached drawing.

- Select block and look at the Properties palette, you will see "Custom" section on the bottom with two parameters - CURRENTLEVEL and NEWLEVEL.

- Try to change them.

- Now - use REGEN command. you should see CURRENTLEVEL and NEWLEVEL in the upper two fields and the sum of CURRENTLEVEL and NEWLEVEL in the third field (in your case it is RESULT)

 

2018-09-09_23-57-14.png

 

 

 

This block was created in Windows version of AutoCAD, but it works in AutoCAD 2016 for Mac.

 

Does this trick suits your needs?

 

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 15 of 21

Anonymous
Not applicable

This does in deed work like a charm in my AutoCAD as well. 

 

I feel very obliged to all your help and time you put in this, that I almost feel ashamed to ask...... 

 

I still have two questions; 

- how does it work? Is the RESULT still an attribute which I could export? 

- Could RESULT be the difference between the two? NEW -/- CURRENT in stead of NEW +/+ CURRENT? 

 

0 Likes
Message 16 of 21

maxim_k
Consultant
Consultant

>>>>- how does it work?
I created block with two dynamic parameters: there are 2 lines inside block on frozen layer - you can see them in Block editor. I added linear parameter without grips to each of the lines, then added stretch action. Then I created field with formula - the sum of these lines length (of course, that is possible only in AC for Windows). Now you can see and edit these two parameters in Properties palette. The lines are invisible, because they are on frozen layer, dynamic grips are hidden, so you cannot see them, when you insert block. But you can see and edit parameters in Properties palette. The calculation of the sum of the lengths of hidden lines occurs automatically through the formula in the RESULT field.

 

>>>>Is the RESULT still an attribute which I could export?
I think - yes, but I modified block once again by replacing text field with attribute with field - see attached dwg, block with name "2". Now the RESULT is an attribute and you can extract it in a usual way. Plus - the new block (2) works in AC 2016 for Mac! I tested it on my side.

 

>>>>Could RESULT be the difference between the two? NEW -/- CURRENT in stead of NEW +/+ CURRENT? 

I think - yes, you can use another Formula: "NEW - CURRENT" instead of "NEW + CURRENT"

Do you need "NEW - CURRENT" calculation? Am I correct?

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 17 of 21

Anonymous
Not applicable

Wonderful! The new block is still fully working here indeed. 

And I tried to add my stretch parameter to get the block again in my preferred layout, and it didn't change the formulas. So that's perfect. 

I would indeed 'need' the difference between NEW and CURRENT ==>      NEW - CURRENT. 

Thank you! 

0 Likes
Message 18 of 21

maxim_k
Consultant
Consultant

Can you try block in attached dwg?

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 19 of 21

Anonymous
Not applicable

Works like a charm. 

I tried to export, and indeed, the RESULT is exportable. 

 

I can work with this version.

I guess that now it's all up to me again 🙂 

 

Thanks again for your effort!!! 

0 Likes
Message 20 of 21

maxim_k
Consultant
Consultant
If the last result is OK for you, please mark my answer as a solution. Thanks

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes