Originally Posted by
avinash00002002
I have a one problem. I can extract data from dimensions, and there is DIMRND set 0.5.
Now I have a lots of dimension text in my list. like. 110.0 , 1100.5 , 637.5, 3137.0
I had rounded up at the time of taking dimensions. now I called up in lisp as
(rtos dmval1 2 1). now I want to write above value in the drawing but as a
110.0 to 110.0
1100.5 to 1100.5
637.5 to 637.5
3137.0 to 3137
above mentioned list can be a min. 6 to max. 1250 or more.
Now my question is how can we determine 1100 is a intger and 637.5 is a real value
can anyone give me help to out.
Thanks,
Avinash
Dear Avinash,
See
Code:
(defun Int_Or_Real0(X)
(if (eq (type x) 'INT) (print "It is a Integer"))
(if (eq (type x) 'REAL) (print "It is a Real"))
(princ)
)
Code:
(Int_Or_Real0 1000); gives "Type is a Integer"
(Int_Or_Real0 1000.0); gives "Type is a Real"
Code:
(defun Int_Or_Real(X)
(if (/= (- x (fix x)) 0) (print "It is not a Integer")
(print "Type could be a Integer"))
)
Code:
(Int_Or_Real 1000); gives "Type could be a Integer"
(Int_Or_Real 1000.0); gives "Type could be a Integer"
(Int_Or_Real 1000.5); gives "It is not a Integer"
Regards HofCAD