Jump to content

Text Field Lisp??


feargt

Recommended Posts

Hi,

 

Attached is an imageof what I'm doing. I got lumbered with a task of checking some section drawings from some of the users.

 

Basically I was wondering if anyone had come up with something similar already.

 

In the picture, there are 3 circles in red and Labeled as 1 is a text object

Labeled 2 is a text object with a text field linked to a dimension 75.37 which is to the left of label 3 and formated to look like 0+075.37

 

Labeled 3 is also a dimension

 

 

I wish to be able if possible to replace the text in Nr 1 by selecting Nr 2 and 3 and have a text field inserted of a formula adding the values of 2 and 3.

 

If anyone can help or has any ideas or better solutions, that would be great.

 

Thanks

CAD-image.jpg

Link to comment
Share on other sites

Heres a text1-text2 write aswer to text 3 change as required

 


(defun C:T1t2 ()     
   (setq text1 (entget (car (entsel "\nSelect text 1 "))))
   (setq anst1 (atof (cdr (assoc 1 text1))))      
   (setq text2 (entget (car (entsel "\nSelect text 2 "))))
   (setq anst2 (atof(cdr (assoc 1 text2))))
   (setq ans (rtos (- anst1 anst2) 2 3))
   (setq en (entsel "\nSelect destination text:"))
   (setq el (entget (car en)))
   (setq el (subst (cons 1 ans) (assoc 1 el) el))
  (entmod el)
  
  ;(entupd en)
) end defun
(PRINC)

Link to comment
Share on other sites

Thanks for the code.

Unfortunately this is not what I am after or at least it doesn't do what I want it to do.

 

The first text that I select in the picture above is a text field, the second is a dimension. I need to create the third text as a text field formula, (text field 1 + dimension 2) so that if there are any changes to the other text fields or dimensions they will automatically be carried through the entire section drawing.

Link to comment
Share on other sites

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