我正在努力與Autolisp,我無法找到我正在尋找的答案。Autolisp列表操作
我有一個空的列表,我用點座標填充它,我已經變成了字符串。所產生的名單是這樣的:
(12.5484,7.6054,0.0000 17.0626,8.1782,0.0000 17.5642,10.7199,0.0000 12.0110,11.4716,0.0000)
是否有任何可能的方式,列表填充可以垂直製成,具有輸出類似:
(12.5484,7.6054,0.0000
17.0626,8.1782,0.0000
17.5642,10.7199,0.0000
12.0110,11.4716,0.0000)
我使用的代碼是:
(setq lst()) ;create empty list named lst
(while
(setq a (getpoint "\nTick the Point")) ;select points
(setq x (rtos(car a))) ;get as X the x of a point (as string)
(setq y (rtos(cadr a))) ;get as Y the y of a point (as string)
(setq z (rtos(caddr a))) ;get as Z the z of a point (as string)
(setq pnt (strcat x "," y ","z))
(setq lst (cons pnt lst)) ;start filling the empty list with the coordinates of the points
)
列表中沒有方向,既不是水平方向,也不是垂直方向。 – ceving
我在想我正在使用錯誤的列表。我可以只寫pnt字符串到一個txt文件也許???我可以承認我很困惑。如果你可以幫忙... – Tony
你的問題是關於一個特定的解決方案,而不告訴我們問題是什麼,爲什麼你認爲這是正確的解決方案。請通過描述您嘗試解決的基本問題來開始您的問題。我懷疑該解決方案與格式化列表無關。 –