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

select numeric texts included in a range

Kypes

Guest
Hello everyone, is any of you aware of any lisp that allows you to select multiple numerical texts in a drawing that are included in a given range?
 
a range of what?

Do you mean an area of space or a numerical range within which to search all the texts of the drawing?
 
proof questo:
Code:
(defun c:selnum (/ intervalloinf intervallosup gru num2 index numero)
 (setq intervalloinf(getreal "\intervallo inferiore: ")
       intervallosup(getreal "\intervallo superiore: ")
       gru(ssget '((0 . "text")))
       num2(ssadd)
 )      

 (repeat (setq index(sslength gru))
  (setq numero(ssname gru (setq index(1- index))))

  (if (and (>= (atof (vla-get-textstring (vlax-ename->vla-object numero))) intervalloinf)
	   (<= (atof (vla-get-textstring (vlax-ename->vla-object numero))) intervallosup)
      )
   (ssadd numero num2)
  )

 )

 (sssetfirst nil num2) 
 (princ)
)
 
hi confutatis, thank you very much for the answer, in fact the lisp works, but from some problem if the range is composed of numbers with decimals, for example if I impose as lower interval 8.5 and the upper one 12.5 the selection is not correct, that is if it is present 12.8 in the selected numbers includes also 12.8 in the range you could solve?
 
I don't know what to tell you, it doesn't make me that mistake. Can you send a piece of drawing with the incriminated numbers, maybe?
 
You're right, now I realized that unfortunately in the files where I have to use this lisp the numbers I have to analyze have as a decimal separator the comma and I think that for this there is no solution. . .
 
solved:biggrin:!!!!in practice to me it was necessary this lisp to identify the index of crowding of a series of offices of which I already knew the surface but which reported as a decimal separator the comma. I solved the problem by creating the closed polylines of the office rooms with the contours command, then I used the lisp arearon that returned the surfaces of the rooms to me in a single stroke (with the point as a decimal separator) and then thanks to the lisp of confutatis "selnum" I replaced the falling surfaces in the intervals that I was interested in the crowding indexes.
thank you very much to confutatis for your availability!:finger:
 
solved:biggrin:!!!!in practice to me it was necessary this lisp to identify the index of crowding of a series of offices of which I already knew the surface but which reported as a decimal separator the comma. I solved the problem by creating the closed polylines of the office rooms with the contours command, then I used the lisp arearon that returned the surfaces of the rooms to me in a single stroke (with the point as a decimal separator) and then thanks to the lisp of confutatis "selnum" I replaced the falling surfaces in the intervals that I was interested in the crowding indexes.
thank you very much to confutatis for your availability!:finger:
Good morning, I exhume this old post to ask if you can pass me the lisp arearon, I can't find it :|
 

Forum statistics

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

Members online

No members online now.
Back
Top