+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19
  1. #1
    Full Member
    Using
    AutoCAD 2009
    Join Date
    May 2010
    Posts
    86

    Default Adding a number before each dtext

    Registered forum members do not see this ad.

    Hi, we have recieved a Bathymetric survey, and the levels have been done in such a stupid way. Say the level at a certain point is 6.7, the numbers have been split into 2 single line text boxes. The number 6 is double the size of the number 7. We need the levels so we can convert the text into 3D, as it is currently all 2D, and there is no points in the drawing, so need to convert text to 3D in Civil 3D. But obviously need all the levels to have the 2 numbers in the same single line text. Anyone got any ideas how i could do this?

    Regards
    Martin

  2. #2
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Lives in Abu Dhabi
    Posts
    2,666

    Default

    Use the command in the express tools ( if you have it of course) called :txt2mtxt
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  3. #3
    Forum Deity
    Using
    AutoCAD 2002
    Join Date
    Sep 2006
    Location
    East Sussex, U.K.
    Posts
    2,997

    Default

    Quote Originally Posted by bigmaz View Post
    Hi, we have received a Bathymetric survey, and the levels have been done in such a stupid way.
    NOT a stupid way. I think that you should say that the levels have been presented in the old fashioned way, consistent with conventional hand drawn charts, and unfortunately not compatible with CAD.

    Ask the supplier of the survey to give you CAD compatible data.

  4. #4
    Forum Deity Dadgad's Avatar
    Using
    AutoCAD 2012
    Join Date
    Nov 2011
    Location
    At the confluence of worthlessness & invaluability
    Posts
    3,176

    Default

    I think Lee Mac has a nice solution for you.
    http://www.lee-mac.com/text2mtext.html
    Thanks Lee!
    Volume and repetition do not validate opinions forged in the absence of thought.

  5. #5
    Full Member
    Using
    AutoCAD 2009
    Join Date
    May 2010
    Posts
    86

    Default

    Quote Originally Posted by eldon View Post
    NOT a stupid way. I think that you should say that the levels have been presented in the old fashioned way, consistent with conventional hand drawn charts, and unfortunately not compatible with CAD.

    Ask the supplier of the survey to give you CAD compatible data.
    Sorry Eldon, I shouldnt have said "stupid". I appreciate what format it has been done in, and it is an old fashioned way. We are going to contact the surveyors, but we were looking for a qucik solution.

    Thanks

  6. #6
    Full Member
    Using
    AutoCAD 2009
    Join Date
    May 2010
    Posts
    86

    Default

    Unfortunately the text to mtext option is not a valid option, thats the first thing I said before I seen the drawing, but there are thousands of individual Dtext objects. I would take forever to go through the survey.

  7. #7
    Forum Deity
    Using
    AutoCAD 2002
    Join Date
    Sep 2006
    Location
    East Sussex, U.K.
    Posts
    2,997

    Default

    You should make sure what units are being used. Conventionally, the large figure was Fathoms and the smaller one was Feet. But if you have any small figures which are larger than 6, then it is probably a decimal system, but not CAD friendly.
    Attached Images

  8. #8
    Full Member
    Using
    AutoCAD 2009
    Join Date
    May 2010
    Posts
    86

    Default

    I am able to filter out the large numbers and delete them. Which leaves me with lots of small numbers. If I could insert the large number into dtext with the small number, that would help. Could I do this?

    Below is an example of what I want to do

    Survey.png

  9. #9
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,816

    Default

    Hi Martin,

    Assuming the smaller text items are closer to each of the corresponding larger text items than the surrounding text, try the following:

    FixText.gif

    Code:
    ;; Fix Text  -  Lee Mac 2012
    ;; Prompts for a selection of Text objects and groups the selected objects
    ;; by equal text height. For each item in the group with smallest text height,
    ;; the program will find the closest item in the group with largest text height
    ;; and modify the content of the smaller item to hold the value of the larger
    ;; item, separated by a point.
    
    (defun c:fixtxt ( / a d e i l s x z )
        (if (setq s (ssget "_:L" '((0 . "TEXT"))))
            (progn
                (repeat (setq i (sslength s))
                    (setq e (entget (ssname s (setq i (1- i))))
                          l (cons (list (cdr (assoc 40 e)) (cdr (assoc 10 e)) e) l)
                    )
                )
                (setq l
                    (vl-sort
                        (LM:GroupByFunction l (lambda ( a b ) (= (car a) (car b))))
                       '(lambda ( a b ) (< (caar a) (caar b)))
                    )
                )
                (setq a (last l))
                (foreach b (car l)
                    (if a
                        (progn
                            (setq d (distance (cadr b) (cadar a))
                                  e (caddr b)
                                  x (car a)
                            )
                            (foreach y (cdr a)
                                (if (< (setq z (distance (cadr b) (cadr y))) d)
                                    (setq d z x y)
                                )
                            )
                            (entmod (subst (cons 1 (strcat (cdr (assoc 1 (caddr x))) "." (cdr (assoc 1 e)))) (assoc 1 e) e))
                            (entdel (cdr (assoc -1 (caddr x))))
                            (setq a (vl-remove x a))
                        )
                    )
                )
            )
        )
        (princ)
    )
    
    ;; Group By Function  -  Lee Mac
    ;; Groups items considered equal by a given predicate function
    
    (defun LM:GroupByFunction ( lst fun / tmp1 tmp2 x1 )
        (if (setq x1 (car lst))
            (progn
                (foreach x2 (cdr lst)
                    (if (fun x1 x2)
                        (setq tmp1 (cons x2 tmp1))
                        (setq tmp2 (cons x2 tmp2))
                    )
                )
                (cons (cons x1 (reverse tmp1)) (LM:GroupByFunction (reverse tmp2) fun))
            )
        )
    )
    (princ)
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  10. #10
    Forum Deity Dadgad's Avatar
    Using
    AutoCAD 2012
    Join Date
    Nov 2011
    Location
    At the confluence of worthlessness & invaluability
    Posts
    3,176

    Default

    Registered forum members do not see this ad.

    Damn, you do nice work Lee.
    I just hope Martin hasn't hunkered down to start doing thousands of these by hand,
    and that he sees this before the surveyors send him another version.
    Volume and repetition do not validate opinions forged in the absence of thought.

Similar Threads

  1. Lisp for adding number to multiple text entities?
    By EvilSi in forum AutoLISP, Visual LISP & DCL
    Replies: 20
    Last Post: 22nd Nov 2012, 06:10 pm
  2. Put value as dtext
    By shakuhachi in forum AutoLISP, Visual LISP & DCL
    Replies: 24
    Last Post: 16th May 2011, 12:53 pm
  3. LISP for adding a number to text..
    By geo999 in forum AutoLISP, Visual LISP & DCL
    Replies: 10
    Last Post: 26th Jan 2011, 04:15 pm
  4. Replies: 4
    Last Post: 29th Dec 2010, 06:28 pm
  5. Adding number to a text string
    By Storm2002 in forum AutoLISP, Visual LISP & DCL
    Replies: 13
    Last Post: 4th May 2009, 04:20 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts