arunr_18 Posted July 20, 2013 Share Posted July 20, 2013 Please help me i am facing a problem of "Error: too few arguments" when i use wtx.lsp for exporting texts to excel. Wtx01(1).lsp Quote Link to comment Share on other sites More sharing options...
pBe Posted July 20, 2013 Share Posted July 20, 2013 too few arguments..... (close f) Quote Link to comment Share on other sites More sharing options...
arunr_18 Posted July 20, 2013 Author Share Posted July 20, 2013 Sorry sir but i didnt get u ...wat u want to say.. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 20, 2013 Share Posted July 20, 2013 Consider this modification on this code for the rest of your routines . (defun c:wtt (/ p1 p2 ss f l a b c d c1 t1 d1 t2 t3 txt) (if (and (setq p1 (getpoint "Point :\n:")) (setq p2 (getcorner p1 "Other corner :\n:")) (setq ss (ssget "_W" p1 p2 '((0 . "*TEXT")))) (if (not (setq f (open "d:\\coords.csv" "w"))) (progn (alert "Can not open Excel file !!") nil) t ) ) (repeat (setq l (sslength ss)) (setq a (ssname ss (setq l (1- l))) b (entget a) c (assoc 10 b) d (assoc 1 b) c1 (cdr c) t1 (rtos (car c1) 2 3) d1 (cdr d) t2 (rtos (cadr c1) 2 3) t3 (rtos (caddr c1) 2 3) txt (strcat t1 "," t2 "," t3 "," d1) ) (write-line txt f) ) ) (if f (close f) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
arunr_18 Posted July 20, 2013 Author Share Posted July 20, 2013 Thank You very much sir...its working... thanks a ton:D Quote Link to comment Share on other sites More sharing options...
pBe Posted July 20, 2013 Share Posted July 20, 2013 Sorry sir but i didnt get u ...wat u want to say.. That is the reason why you get the error message .. too few arguments. Consider this (defun c:wtx() (if (and (setq p1 (getpoint "\nFirst corner :")) (setq p2 (getcorner p1 "\n: Other corner :")) (setq ss (ssget "w" p1 p2 [b][color="#4169e1"]'((0 . "INSERT")[/color][/b]))) (setq l (sslength ss) n 0) [b][color="#4169e1"] (setq fto (findfile "coords.csv"))[/color][/b] (print l) ) (progn (setq f (open fto "w")) (repeat l (setq a (ssname ss n) b (entget a) c (assoc 10 b) d (assoc 2 b) c1 (cdr c) t1 (rtos (car c1) 2 3) d1 (cdr d) t2 (rtos (cadr c1) 2 3) t3 (rtos (caddr c1) 2 3) txt (strcat t1 "," t2 "," t3 "," d1) n (+ n 1) ) (write-line txt f) ) [b][color="#4169e1"](close f)[/color][/b]);<--- your error fix ) [b](startapp "Notepad" fto)[/b] (princ) ) Quote Link to comment Share on other sites More sharing options...
arunr_18 Posted July 20, 2013 Author Share Posted July 20, 2013 Thank you sir.. Quote Link to comment Share on other sites More sharing options...
arunr_18 Posted July 20, 2013 Author Share Posted July 20, 2013 Sir can u give me a lisp for preparing Longitudinal section Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 20, 2013 Share Posted July 20, 2013 Thank You very much sir...its working...thanks a ton:D You're welcome . Quote Link to comment Share on other sites More sharing options...
pBe Posted July 20, 2013 Share Posted July 20, 2013 Thank you sir.. Sir can u give me a lisp for preparing Longitudinal section Ehh... are your replying to me or Tharwat? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 20, 2013 Share Posted July 20, 2013 (startapp "Notepad" fto) You are opening the .csv file with notepad Quote Link to comment Share on other sites More sharing options...
pBe Posted July 20, 2013 Share Posted July 20, 2013 You are opening the .csv file with notepad Yes, its still basically a text file. Quote Link to comment Share on other sites More sharing options...
arunr_18 Posted July 20, 2013 Author Share Posted July 20, 2013 Sir am thank full to both of u... and asking help from both of u too... Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 20, 2013 Share Posted July 20, 2013 Sir can u give me a lisp for preparing Longitudinal section I have no idea about this section , so can you please post an image of that section or a drawing ? Quote Link to comment Share on other sites More sharing options...
neophoible Posted July 20, 2013 Share Posted July 20, 2013 I have no idea about this section , so can you please post an image of that section or a drawing ?Yes, it would be good to have DWGs with both before and after, that is, what you start with and what you hope to end up with. Also, arunr_18, you did not really say what your functions were for. Are they intended to prepare the section you mention? BTW, I noticed that the file name is the same in two of them, but is on a different drive for the other. All of them open the file for writing, which means any previous data would be overwritten. Also, in any case WT would overwrite WTT, & vice versa. I mention this just to make sure that is your intention. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.