• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

write the difference between two numbers

  • Thread starter Thread starter micheledag
  • Start date Start date

micheledag

Guest
Dearest,
Are you aware of a list that does the following?
I would need a lisp that, given two texts of the numbers (e.g. a ground quota and a bottom excavating quota), by clicking on it, returns me the value of the difference between the two and assigns it to a third text already existing in the drawing (practically I get the depth of the excavation).
autocad 2010.
Thank you all.
 
Given the many answers, I add one too.....

command quotaps; select the first text, the second, the third and the latter receives the difference between the first and the second;
if the third is not there, from the sending and you can insert the insertion point of the third text containing the calculated value.

bye
 

Attachments

... seems made to order!
What are you talking about? There are a bizzeffe di lisp that "give two texts of the numbers, clicking on them return the value of the difference between the two and assign it to a third text already existing in the drawing..." :tongue:

If only rpor66 had googlato...:wink:
 
for completeness I attach a written function long ago and that actually the text strings contain only numbers, that the + and - if they exist, are single and only at the beginning of the string and that the decimal separator, if existing and in this case the point, is arranged in all positions less the last.

syntax: (verstrnum string)
topics: string - text string

the value returned and t, if the condition is met, or nil
Code:
(defun verstrnum (strin / numberstrin)
(setq numberstrin
(vl- list-> string
(vl- remove- if- not)
(lambda (x) (or (= x 46) (< = 48 x 57))
(vl- string- > list strin)
)
)
)
(if (= (strlen strin) (strlen numberstrin))
t
nil
)
)
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top