Results 1 to 4 of 4

Thread: Export and Import to Excel and AutoCAD

  1. #1
    Active Member
    Join Date
    2005-02
    Posts
    95
    Login to Give a bone
    0

    Default Export and Import to Excel and AutoCAD

    How can we Export and Import data to AutoCAD and Excel. I know it is possible in VBA but I want to know in Lisp. pls. send me an example for me.

  2. #2
    I could stop if I wanted to kpblc2000's Avatar
    Join Date
    2006-09
    Posts
    212
    Login to Give a bone
    0

    Default Re: Export and Import to Excel and AutoCAD

    http://dwg.ru/search_result.php?res=...87&sid=&sfor=1
    To translate it you can use http://babelfish.altavista.com/ (from Russian to English)

  3. #3
    All AUGI, all the time Avatart's Avatar
    Join Date
    2004-06
    Location
    Upsidedown in dreamtown
    Posts
    928
    Login to Give a bone
    0

    Default Re: Export and Import to Excel and AutoCAD

    Quote Originally Posted by kpblc2000
    The BabelFish translation does not make much sense unfortunately.

    What sort of information are you hoping to transfer between the two programs?

  4. #4
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Export and Import to Excel and AutoCAD

    Quote Originally Posted by avinash00002002
    How can we Export and Import data to AutoCAD and Excel. I know it is possible in VBA but I want to know in Lisp. pls. send me an example for me.
    Here is an example.

    Code:
    (defun doExcelApp (/ EXCELAPP INT OWKSHT)
      (if
        (not msxl-acos)
         (vlax-import-type-library
           :tlb-filename
           "C:/Program Files/Microsoft Office/Office10/Excel.exe"
           :methods-prefix
           "msxl-"
           :properties-prefix
           "msxl-"
           :constants-prefix
           "msxl-"
          )
      )
      (setq ExcelApp (vlax-get-or-create-object "Excel.Application"))
      (setq	owksht
    	 (vlax-get (vlax-invoke (vlax-get Excelapp "Workbooks") "Add")
    		   "ActiveSheet"
    	 )
      )
      (vlax-put Excelapp "visible" 1)
      (MSXL-PUT-NUMBERFORMAT
        (MSXL-GET-RANGE OWKSHT "B2:C500")
        "0.00000000"
      )
      (MSXL-PUT-COLUMNWIDTH (MSXL-GET-RANGE OWKSHT "A1") 35.0)
      (MSXL-PUT-COLUMNWIDTH (MSXL-GET-RANGE OWKSHT "B1:C1") 20.0)
      (MSXL-PUT-COLUMNWIDTH (MSXL-GET-RANGE OWKSHT "D1") 5.0)
      (MSXL-PUT-COLUMNWIDTH (MSXL-GET-RANGE OWKSHT "E1") 20.0)
    	; GET HEADING RANGE
      (setq int (MSXL-GET-INTERIOR (MSXL-GET-RANGE OWKSHT "A1:C1")))
    	; SET BACKGROUND COLOR OF HEADING RANGE TO YELLOW
      (MSXL-PUT-COLORINDEX INT 6)
    	; SET FILL PATTERN OF HEADING RANGE TO SOLID
      (MSXL-PUT-PATTERN INT MSXL-XLSOLID)
    	; Push data into cells
      (msxl-put-value2 (msxl-get-range owksht "A1") "Column 1")
      (msxl-put-value2 (msxl-get-range owksht "B1") "Column 2")
      (msxl-put-value2 (msxl-get-range owksht "C1") "Column 3")
    
    )
    R.K. McSwain | CAD Panacea |

Similar Threads

  1. 2012: Import an Excel file into AutoCAD
    By rbhazie in forum AutoCAD General
    Replies: 5
    Last Post: 2014-10-06, 05:09 PM
  2. Import / Export Excel Spreadsheets
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 1
    Last Post: 2014-03-13, 05:07 AM
  3. How to import excel table to autocad
    By mandy in forum AutoCAD General
    Replies: 5
    Last Post: 2008-10-31, 06:32 PM
  4. Export/Import Text, Attribute data, tags etc from drawings and Excel
    By Subramanyam.Perivenkata in forum AutoLISP
    Replies: 3
    Last Post: 2006-03-23, 06:06 PM
  5. Replies: 3
    Last Post: 2006-03-08, 05:45 PM

Posting Permissions

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