samifox Posted May 8, 2017 Posted May 8, 2017 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 Quote
steven-g Posted May 8, 2017 Posted May 8, 2017 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. Quote
samifox Posted July 11, 2017 Author Posted July 11, 2017 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? Quote
steven-g Posted July 11, 2017 Posted July 11, 2017 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. Quote
samifox Posted July 11, 2017 Author Posted July 11, 2017 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 Quote
samifox Posted July 11, 2017 Author Posted July 11, 2017 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? Quote
BIGAL Posted July 12, 2017 Posted July 12, 2017 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. Quote
samifox Posted July 12, 2017 Author Posted July 12, 2017 seems like the setenv store the value along with the drawing. is this the case? Quote
steven-g Posted July 12, 2017 Posted July 12, 2017 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) Quote
samifox Posted July 12, 2017 Author Posted July 12, 2017 it seems like the drawing hold the value, i have restarted the pc and its still there Quote
BIGAL Posted July 12, 2017 Posted July 12, 2017 What about a single text on a non plot layer change it, values change. Quote
steven-g Posted July 12, 2017 Posted July 12, 2017 +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. Quote
samifox Posted July 13, 2017 Author Posted July 13, 2017 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 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.