首先
谢谢Hippe013、satishrajdev和BIGAL
我对我的问题感到抱歉,它不清楚,而且它出了问题
我使用了Lee Mac的转换代码http://www.lee-mac.com/stringtolist.html
我的第一个清单是:
- (defun c:coordformat ()
- (setq coords '("102.614364152051,17.95733901085014,0 102.6148784682264,17.95771822280192,0 102.6142663942859,17.95835128371222,0 102.6141224420007,17.95824935570436,0 102.6137704879814,17.95798561968717,0 102.614364152051,17.95733901085014,0"))
- ;and when I used this function
- (setq coords (LM:str->lst coords " ")) ;It was not convert to list coordinate format
- )
- (defun LM:str->lst ( str del / len lst pos )
- (setq len (1+ (strlen del)))
- (while (setq pos (vl-string-search del str))
- (setq lst (cons (substr str 1 pos) lst)
- str (substr str (+ pos len))
- )
- )
- (reverse (cons str lst))
- )
。
当我使用这段代码时,它并没有将列表转换为坐标格式。它是:
("102.614364152051,17.95733901085014,0" "102.6148784682264,17.95771822280192,0" "102.6142663942859,17.95835128371222,0" "102.6141224420007,17.95824935570436,0" "102.6137704879814,17.95798561968717,0" "102.614364152051,17.95733901085014,0")
坐标列表格式应为:
((102.614364152051 17.95733901085014 0) (102.6148784682264 17.95771822280192 0) (102.6142663942859 17.95835128371222 0) (102.6141224420007 17.95824935570436 0) (102.6137704879814 17.95798561968717 0) (102.614364152051 17.95733901085014 0))
或者应该是:
((102.614364152051 17.95733901085014) (102.6148784682264 17.95771822280192) (102.6142663942859 17.95835128371222) (102.6141224420007 17.95824935570436) (102.6137704879814 17.95798561968717) (102.614364152051 17.95733901085014))
如果你还有别的事
请帮帮我
麻省理工学院 |