+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15
  1. #11
    Senior Member CafeJr's Avatar
    Using
    AutoCAD 2010
    Join Date
    Oct 2013
    Location
    Brazil, São Paulo, Sorocaba
    Posts
    216

    Default

    Registered forum members do not see this ad.

    Thank you Tharwat... I don't know if it's simple, but the idea is, is only collect a spread texts (words) in a drawing in order of selection... to export it to Excel.

  2. #12
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,053

    Default

    Quote Originally Posted by CafeJr View Post
    Thank you Tharwat... I don't know if it's simple, but the idea is, is only collect a spread texts (words) in a drawing in order of selection... to export it to Excel.
    Try this program and let me know .
    Note: At the end of selecting texts , just press enter and type ( n ) or ( no ) to display the dialog for the last process .

    Code:
    (defun c:Test  (/ *error* _dialog dlg s name s l k save path o)
    ;;;        Tharwat 13.01.2015        ;;
      (defun *error*  (msg)
        (if (and dlg (findfile dlg))
          (vl-file-delete dlg)
          )
        (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*"))
          (princ (strcat "\n** Error: " msg " **"))
          )
        (princ)
        )
      (defun _dialog  (/ id f)
        (cond
          ((not
             (and
               (setq dlg (vl-filename-mktemp nil nil ".dcl"))
               (setq f (open dlg "w"))
               (write-line
                 "test : dialog {label = \"Test Strings\"; width = 40;
                 : text { key = \"path\"; }
                 spacer_1 ;
                 : list_box { key = \"lst\"; height = 18;}
                 : boxed_row {
                 : button { label = \"Okay\"; key = \"oki\"; width = 12;}
                 : button { label = \"Exit\"; key = \"esc\"; is_default = true; is_cancel = true; width = 12;}
                 : button { label = \"Save to\"; key = \"sv\"; width = 12;}
                 }}"
                 f
                 )
               (not (close f))
               )
             )
           (alert "Can't load the temporary file <!>")
           )
          ((or (not dlg)
               (not (> (setq id (load_dialog dlg)) 0))
               (not (new_dialog
                      "test"
                      id
                      )
                    )
               )
           (princ "\n Can not load Dialog !")
           )
          (t
           (start_list "lst")
           (mapcar 'add_list (reverse l))
           (end_list)
           (mode_tile "oki" 1)
           (set_tile "lst" "0")
           (action_tile
             "sv"
             "(if (setq path (getfiled \"Save to\" (getvar 'DWGPREFIX) \"csv\" 1))
                  (progn
                  (set_tile \"path\" path)
                  (mode_tile \"oki\" 0))
                (mode_tile \"oki\" 1))"
             )
           (action_tile
             "oki"
             "(setq save t)(done_dialog)"
             )
           (action_tile "esc" "(setq save nil)(done_dialog)")
           (start_dialog)
           (unload_dialog id)
           (vl-file-delete dlg)
           )
          )
        save
        )
      (while
        (cond
          ((and (setq s (car (entsel "\n Pick Texts :")))
                (wcmatch (cdr (assoc 0 (entget s))) "TEXT,MTEXT")
                )
           (setq l (cons (cdr (assoc 1 (entget s))) l))
           )
          ((or s (not s))
           (princ "\nInvalid Selection !! Select text ONLY ")
           (initget 6 "Yes No")
           (or (not (setq k
                           (getkword "\n Missed !! Continue [Yes/No] <Yes> :")))
               (eq k "Yes")
               )
           )
          )
        )
      (if (and l (setq save (_dialog)) (setq o (open path "w")))
        (progn
          (mapcar '(lambda (x) (write-line x o)) (reverse l))
          (close o)
          (princ "\n Well done ...")
          )
        (princ "\n Exit by User ")
        )
      (princ)
      )

  3. #13
    Senior Member CafeJr's Avatar
    Using
    AutoCAD 2010
    Join Date
    Oct 2013
    Location
    Brazil, São Paulo, Sorocaba
    Posts
    216

    Default

    Woowwwww... He he he... Thanks Tharwat!... It Works as good as I need!!!...


    The unique "delay" that I have it's work with spreadsheets (by the number of usages), I'm thinking if has a way to fill up one spreadsheet only (I don't know), or using a Ram memory to copy these texts to paste one a cell in a Excel file open... It's that possible?...

  4. #14
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,053

    Default

    Quote Originally Posted by CafeJr View Post
    Woowwwww... He he he... Thanks Tharwat!... It Works as good as I need!!!...
    I am happy that you liked the program

    Quote Originally Posted by CafeJr View Post
    The unique "delay" that I have it's work with spreadsheets (by the number of usages), I'm thinking if has a way to fill up one spreadsheet only (I don't know), or using a Ram memory to copy these texts to paste one a cell in a Excel file open... It's that possible?...
    I don't think that I got your point

  5. #15
    Senior Member CafeJr's Avatar
    Using
    AutoCAD 2010
    Join Date
    Oct 2013
    Location
    Brazil, São Paulo, Sorocaba
    Posts
    216

    Default

    Registered forum members do not see this ad.

    Sorry,


    Let me try to explain!...


    Every time that I use it, I'll create a spreadsheet (it's ok, no problem, it's help a lot even why I need to rewrite the path on Excel!).


    It'll be used to follow electrical cables on a drawing, think in one electrical installation I have one point (origin) and a target of the cable (instruments on the field), so, I have to do these follow the path texts (address of electrical pipes or cable trays) to select where the cable pass through, are many cable to do it one by one, you got it?...
    Attached Images

Similar Threads

  1. Is it possible to remove a text string out of all selected text?
    By yonderbob in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 6
    Last Post: 28th Sep 2012, 03:12 pm
  2. Rotate all selected text
    By seventy9mph in forum AutoLISP, Visual LISP & DCL
    Replies: 10
    Last Post: 5th Mar 2011, 05:03 pm
  3. Exporting text
    By JimBob in forum AutoCAD Beginners' Area
    Replies: 7
    Last Post: 10th Feb 2009, 04:56 pm
  4. Replies: 5
    Last Post: 11th Oct 2006, 05:34 am
  5. Selected text fill
    By givrdad in forum AutoCAD General
    Replies: 1
    Last Post: 8th Feb 2006, 11:23 pm

Tags for this Thread

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