feargt Posted April 28, 2009 Share Posted April 28, 2009 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 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 29, 2009 Share Posted April 29, 2009 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) Quote Link to comment Share on other sites More sharing options...
feargt Posted April 29, 2009 Author Share Posted April 29, 2009 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. 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.