Jump to content

Recommended Posts

Posted

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?? 8)

example.JPG

Posted

Anybody know a solution?? or maybe have some similiar lisp??

Posted

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?

Posted
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??:huh:

Posted

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))))

Posted

You're really fast!!!:shock::shock::D 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:!!!!!!!!!! :thumbsup:

Posted
You're really fast!!!:shock::shock::D 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:!!!!!!!!!! :thumbsup:

 

No problem mate - happy to help out. :)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...