goldy2000 Posted June 17, 2009 Posted June 17, 2009 Hello to the best CAD FORUM in this part of internet:D...I have a question, is it possible to make a lisp that can export value of Z coordinate to a new layer (called VISINA_TEXT)?? I have 3D point and I need to export (allocate) value of Z coord in the text file(but two digits only after comma: 99,37 in this case) which is situated like it is in the example file?? Quote
goldy2000 Posted June 17, 2009 Author Posted June 17, 2009 Anybody know a solution?? or maybe have some similiar lisp?? Quote
Lee Mac Posted June 17, 2009 Posted June 17, 2009 I don't quite understand your request - you mention exporting the text to a new layer, but then you talk of exporting to a text file... which do you want? Quote
goldy2000 Posted June 17, 2009 Author Posted June 17, 2009 I don't quite understand your request - you mention exporting the text to a new layer, but then you talk of exporting to a text file... which do you want? Hy man!! I mean to assign (cannot find appropriate word for that) text that will contain Z coord. Example: I have 3D point with coord (X,Y,Z --> 65,24,22.33), so I need to extract Z coord (in this case 22.33) to be written in text 22.33 (but in some new layer), the problem is to ''read'' Z coord and ''write'' in text form...was this helpful?? Quote
Lee Mac Posted June 17, 2009 Posted June 17, 2009 Try this: (defun c:ztxt (/ ss) (vl-load-com) (if (setq ss (ssget '((0 . "POINT")))) (mapcar (function (lambda (x) (Make_Text x (rtos (caddr x) 2 2)))) (mapcar (function (lambda (x) (cdr (assoc 10 (entget x))))) (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))))) (princ)) (defun Make_Text (pt val) (entmake (list (cons 0 "TEXT") (cons 8 "VISINA_TEXT") (cons 10 pt) (cons 40 (getvar "TEXTSIZE")) (cons 1 val) (cons 50 0.0) (cons 7 (getvar "TEXTSTYLE")) (cons 71 0) (cons 72 0) (cons 73 0) (cons 11 pt)))) Quote
goldy2000 Posted June 17, 2009 Author Posted June 17, 2009 You're really fast!!!:shock: I tried it and it works PERFECTLY!!! You solved me lot of things that I asked in forum, thanks a lot man, you spare me so many hours and sitting in front of monitor:lol:!!!!!!!!!! Quote
Lee Mac Posted June 17, 2009 Posted June 17, 2009 You're really fast!!!:shock: I tried it and it works PERFECTLY!!! You solved me lot of things that I asked in forum, thanks a lot man, you spare me so many hours and sitting in front of monitor:lol:!!!!!!!!!! No problem mate - happy to help out. Quote
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.