Jump to content

add + operator to a formula that use field


Recommended Posts

hi

using acad 2017,

 

i use fields with object's Y position to read the current level.usualy is a relative level that start with 0.00

 

now i want to do the same but with absolute level,

 

 

for example , moving the level symbol and the associated text shows +0.10, i want autocad to add 290.10 to +0.10 reading so the total reading displays + 290.20

 

not sure how to do it?

 

Thanks in advance

S

Link to comment
Share on other sites

When you are in the field dialogue, choose formula from the field names section, and in the formula entry box you can place your constant and use right click to enter another field (object). You can add or choose multiple fields within the formula, or diesel expressions so you can also access stored variables.

Field.jpg

Link to comment
Share on other sites

  • 2 months later...

hi

using formula like 290.10+(-209.57/100) to show an absolute level works great till the designer called to ask to set the 0.00 to 286.60 instead of 290.10.

 

now i had created millions of copies to that field, that mean that i have to go 1 by 1 and to change them, manually?

how can i set a variable to hold my absolute value and still be able to use that formula?

Link to comment
Share on other sites

You can use a diesel expression in one (or more) of the fields you use in the formula, and then all you need do is change the variable value with the setenv command, and it will update on regen, you might need to alter the Fieldeval variable fieldeval=31 to get the fields to update nicely.

 

 

Field3.jpg

Link to comment
Share on other sites

You can use a diesel expression in one (or more) of the fields you use in the formula, and then all you need do is change the variable value with the setenv command, and it will update on regen, you might need to alter the Fieldeval variable fieldeval=31 to get the fields to update nicely.

 

 

[ATTACH=CONFIG]61716[/ATTACH]

 

didnt tried it yet but you are the king !!!! thanks

Link to comment
Share on other sites

i test it, its great, i close and open cad so its saved with the drawing or with the Operation system? what happened when i open the same drawing in other pc?

setenv is an Autolisp function? getend is diesel ....how they interact?

Link to comment
Share on other sites

It sounds like it would be easier using normal text that is calculated of a base point then use something like our "add to levels lsp" to adjust all the required text.

Link to comment
Share on other sites

Nope setenv is just a command to set an environmental variable and it is stored in the Windows registry, so it is not saved with the drawing it is the same value for all drawings. Looking a bit more it appears as though the setenv and getenv are unique to LT as command line functions (yeah one up for the LT guys), though it is available to full Autocad through Lisp and probably Diesel. You'll have to test that yourself, aren't there any easy accessible variables in full Autocad?

Another method would be to create a custom DWGPROPS value and this also becomes available in the field selection list (and is stored with the drawing)

Link to comment
Share on other sites

+1 BIGAL

I would have thought it would read it in as text and fail, but it works in the formula field just fine both text and mtext.

Link to comment
Share on other sites

Nope setenv is just a command to set an environmental variable and it is stored in the Windows registry, so it is not saved with the drawing it is the same value for all drawings. Looking a bit more it appears as though the setenv and getenv are unique to LT as command line functions (yeah one up for the LT guys), though it is available to full Autocad through Lisp and probably Diesel. You'll have to test that yourself, aren't there any easy accessible variables in full Autocad?

Another method would be to create a custom DWGPROPS value and this also becomes available in the field selection list (and is stored with the drawing)

 

hi steven

 

yaa set it a costume property as ABS and than get it in the field works better, now i can be sure its saved with the drawing

 

:)

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...