TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Krushert on April 12, 2011, 04:04:29 PM
-
So I started with some of Kerry's code (http://www.theswamp.org/index.php?topic=10317.msg131450#msg131450) and then realizing it is spitting out in real numbers and I need to convert to string form. When I tried to do it I am getting extra characters. Why??? If I remove the rtos, it retuns the real number in the correct form.
"3'-3 1/4\" "
_$
it should read 3'-3 1/4"
(SETQ DimEnt2 (CAR (ENTSEL "\nSelect Height Dimension :") )
DimObj2 (VLAX-ENAME->VLA-OBJECT DimEnt2)
Measurement2 (rtos (VLAX-GET DimObj2 'Measurement) 4 6)
)
-
Try the two :-) :
(alert "3'-3 1/4\"")
(alert "3'-3 1/4")
-
Okay? :| That is weird.
But I can see that I did not take it far enough. I was just looking at what was being returned in watch window thinking that was what I was going to get.
Thank you.
-
Okay? :| That is weird.
But I can see that I did not take it far enough. I was just looking at what was being returned in watch window thinking that was what I was going to get.
Thank you.
No prob :-)
-
Ask yourself: How does one express a quotation mark in a string without signifying the end of the string itself?
The same applies to the backslash - consider the following:
(alert "a\tb")
(alert "a\\tb")
-
Or try (alert (chr 34)) :lol:
-
Escape characters
http://en.wikipedia.org/wiki/Escape_character
-
Ask yourself: How does one express a quotation mark in a string without signifying the end of the string itself?
Oooooohhhhhh. (http://i717.photobucket.com/albums/ww173/prestonjjrtr/Smileys/1lg019idea.gif)
Okay that explains it. Thanks.