If you *always* have exactly n characters in front of the number, you can
use the following:
(atof (substr a (+ n 1)))
with n=1 for G125.5 etc. or n=2 for TC137.89 etc. (where a is the string
with the attribute value)
If you have different numbers of text you can use a loop like this (not
tested!):
(setq zvalue 0.0)
(setq n 0)
(while (and (= zvalue 0.0) (< n (strlen a)))
(setq zvalue (atof (subst a (+ n 1))))
(setq n (1+ n))
)
--
bob.at
CAD & GIS Services, Graz, Austria
schrieb im Newsbeitrag news:5966228@discussion.autodesk.com...
This is a great lisp by the way, it works great. I have a question
though... I made a spot elevation block, then I want to use your lisp to
change those blocks to the given elevation. However, I'd like to preface the
elevation with a character or two (P, TC, TW, G) to indicate pavement, top
of curb, top of wall, ground, etc. i.e.: G125.5 or TC137.89 etc. I know I
can just add another attribute, but I'd like to have just the one since it
will be easier to move a single attribute around when there is other
linework in the way. Is it possible to extract only the number from the
attribute and assign that value for the Z coordinate?
Craig