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

    Default Exporting selected text to Excel Cell

    Registered forum members do not see this ad.

    Guys,


    I need one help, someone knows one Lisp that I can get Texts (words) on AutoCad and export it in order of selection to a cell on Excel...


    Eg.: If I have 10 words, as I'll selecting it and when finished these then words will be exported to a cell (could be cels) to Excel.


    Thanks in advance...

  2. #2
    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,085

    Default

    Can you explain your goal with an example ?
    Are you wanting to select one by one to keep them in the same order exported to Excel ?

  3. #3
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,892

    Default

    Getexecl.lsp it is a library of excel-autocad functions both ways.
    Attached Files
    A man who never made mistakes never made anything

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

    Default

    Quote Originally Posted by Tharwat View Post
    Can you explain your goal with an example ?
    Are you wanting to select one by one to keep them in the same order exported to Excel ?
    In these picture In trying to clarify the task.

    Tharwat, the selection is one by one, because I have a Big drawing with a lot of information, and I need to follow the names and select it to export by selection order. To show the example I put A and B, but it's only to exemplify, not is necessary to work with two collumns or two line of cells, only get the words and export it to Excel in order of selection, it will help a lot.
    Attached Images
    Last edited by CafeJr; 10th Jan 2015 at 09:49 pm.

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

    Default

    Quote Originally Posted by BIGAL View Post
    Getexecl.lsp it is a library of excel-autocad functions both ways.
    Thanks Bigal, I will try it too.

  6. #6
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,892

    Default

    Your request is two parts, actually writing to excel is the easy bit and thinking about provide you always use A C C etc it can be done.

    Thinking about it now if you just make a list of text (A-1 B-1 B-3 A-2 ETC ) You can take 1st character and check if its A B C D etc and set column (asc(text)) last number A-23 = 23+row offset = cell row so if some missing will jump over blanks. B-23 = cell 2,27

    Thanks to Lee-mac for this it will give a number as an answer.
    Code:
    ; use say nth of your list of text selected (setq nthtext (nth x testlist))
    ; to use (setq cellnum (Lm:parsenumbers nthtext))
    
    ;;-------------------=={ Parse Numbers }==--------------------;;
    ;;                                                            ;;
    ;;  Parses a list of numerical values from a supplied string. ;;
    ;;------------------------------------------------------------;;
    ;;  Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
    ;;------------------------------------------------------------;;
    ;;  Arguments:                                                ;;
    ;;  s - String to process                                     ;;
    ;;------------------------------------------------------------;;
    ;;  Returns:  List of numerical values found in string.       ;;
    ;;------------------------------------------------------------;;
    
    (defun LM:ParseNumbers ( s )
      (
        (lambda ( l )
          (read
            (strcat "("
              (vl-list->string
                (mapcar
                  (function
                    (lambda ( a b c )
                      (if
                        (or
                          (< 47 b 58)
                          (and (= 45 b) (< 47 c 58) (not (< 47 a 58)))
                          (and (= 46 b) (< 47 a 58) (< 47 c 58))
                        )
                        b 32
                      )
                    )
                  )
                  (cons nil l) l (append (cdr l) (list nil))
                )
              )
              ")"
            )
          )
        )
        (vl-string->list s)
      )
    )
    A man who never made mistakes never made anything

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

    Default

    Sorry Bigal, the text at AutoCad, isn't a specific address to Excel, it's any kind of text, to be exported to Excel in "any" cell. I didn't pay attention on AutoCad text that I wrote... similar a Excel cell address...

  8. #8
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows 8.1
    Discipline
    Landscape
    Using
    AutoCAD 2015
    Join Date
    Apr 2010
    Posts
    2,957

    Default

    Quote Originally Posted by BIGAL View Post
    Getexecl.lsp it is a library of excel-autocad functions both ways.
    Cool lisp rouitne

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

    Default

    Quote Originally Posted by BIGAL View Post
    Getexecl.lsp it is a library of excel-autocad functions both ways.


    Bigal, I don't know why, but I loaded the Getexcl lisp but it doesn't work, the command isn't recognized. I did it in two AutoCad softwares, 2012 and 2013 versions...

  10. #10
    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,085

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by CafeJr View Post
    Bigal, I don't know why, but I loaded the Getexcl lisp but it doesn't work, the command isn't recognized. I did it in two AutoCad softwares, 2012 and 2013 versions...
    The GetExcel.lsp is a function to deal to Excel files that release after the year 2003 and which their extension files would be formatted to .xls and xlsx ... etc so this function alone does not help you with any .

    Anyway , I have a plan to write a program with a dialog box to obtain the selected text strings before exporting them to txt format or Excel file with a format .csv . Would this be suitable for your needs ?

    I am busy at the moment but would write it since that I think it would be handy program in general .

    Tharwat

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