+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17
  1. #1
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Sep 2014
    Posts
    15

    Unhappy how to use

    Registered forum members do not see this ad.

    hi all,
    please any one help me
    how to use this auto cad text to excel Lisp
    Attached Files

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,735

    Default

    The program's description reads "A program to create a csv file from a text based table in AutoCAD." So the first question is have you created a text based table in AutoCAD? The second question is do you know how to load a lisp routine? And the third question is once the program is loaded do you know how to run it? Your turn.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  3. #3
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Sep 2014
    Posts
    15

    Default

    yah i have created text based table in autocad and i know how to load lisp but it is not working please help me
    i have 740 Cross section every cross section have 15 item every item have LHS, RHS i don't know how to do...?

  4. #4
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,735

    Default

    For someone to test the lisp program it would be helpful to have one of your drawings so they can troubleshoot the problem. Why? Because they will see exactly what you are seeing.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  5. #5
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Sep 2014
    Posts
    15

    Default

    here i attached sample drawing
    Attached Files

  6. #6
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,735

    Default

    Are you talking about the tables in the upper right hand corner of each sheet?
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  7. #7
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Sep 2014
    Posts
    15

    Default

    cage measurement

  8. #8
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Sep 2014
    Posts
    15

    Default

    yes that is the text table which is drawn by line

  9. #9
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Sep 2014
    Posts
    15

    Default lisp code not working

    hi all,
    please any one help me

    i have created text based table in autocad and and i downloaded this lisp from internet but it is not working i have 740 Cross section every cross section have 13 item every item have LHS, RHS i don't know how to do...?
    please any one tel me a easy way to export Quantity
    here i attached sample Drawing and lisp.




    ;; KAL to CSV; A program to create a csv file from a text based table in AutoCAD
    ;; Author: Doug Barnes
    ;; Company: Grantek Systems Integration
    (defun Cleanup_Text ()
    ;; find all the text with no content and erase them
    (setq nil_text
    (ssget "x"
    '((-4 . "<and") (0 . "TEXT") (1 . "") (-4 . "and>"))
    )
    )
    ;; search for text with no content
    (if nil_text
    (command "erase" nil_text "")
    )
    ;; erase text with no content
    )
    ;; end cleanup_text defun
    ;;================================================ ==========================================
    (defun Gather_Text ()
    (setq Text_SS (ssget '((0 . "TEXT"))))
    ;; create a selection set for all text selected by the user.
    )
    ;; end Gather_Text defun
    ;;================================================ ==========================================
    (defun MakeList_X_Y_Text (Text_SS)
    ;; Make a list of x-coords, y-coords and text
    (setq MakeList_cnt 0)
    (repeat (sslength Text_SS)
    (setq X_cord
    (if (= (cdr (assoc 72 (entget (ssname Text_SS MakeList_cnt))))
    0
    )
    ;; check for the text's justification
    (cadr (assoc 10 (entget (ssname Text_SS MakeList_cnt))))
    ;; if left justified use first alignment point
    (cadr (assoc 11 (entget (ssname Text_SS MakeList_cnt))))
    ;; else use second alignment point
    )
    ;;end if
    )
    ;;end Setq
    (setq y_cord
    (if (= (cdr (assoc 72 (entget (ssname Text_SS MakeList_cnt))))
    0
    )
    ;; check for the text's justification
    (caddr (assoc 10 (entget (ssname Text_SS MakeList_cnt))))
    ;; if left justified use first alignment point
    (caddr (assoc 11 (entget (ssname Text_SS MakeList_cnt))))
    ;; else use second alignment point
    )
    ;;end if
    )
    (setq List_X_Y_Text
    (append
    List_X_Y_Text
    (list
    (list
    (cons "X coord"
    X_cord
    )
    (cons "Y coord" y_cord)
    (cons "Text"
    (cdr (assoc 1 (entget (ssname Text_SS MakeList_cnt))))
    )
    )
    )
    )
    )
    ;;make assocation list of x, y and text dotted pairs
    (setq MakeList_cnt (1+ MakeList_cnt))
    ;; index to next entity
    )
    ;;repeat
    )
    ;;end MakeList_X_Y_Text defun
    ;;================================================ ==========================================
    (defun Sort_by_X (List_X_Y_Text)
    ;; re-order list from left to right
    (setq X_List
    (vl-sort
    List_X_Y_Text
    (FUNCTION (LAMBDA (E1 E2) (< (cdar E1) (cdar E2))))
    )
    )
    )
    ;; end Sort_by_X defun
    ;;================================================ ==========================================
    (defun Sort_by_Y (List_X_Y_Text_Col)
    ;; re-order list from top to bottom
    (setq Y_List
    (vl-sort
    List_X_Y_Text_Col
    (FUNCTION (LAMBDA (E1 E2) (> (cdadr E1) (cdadr E2))))
    )
    )
    )
    ;; end Sort_by_Y defun
    ;;================================================ ==========================================
    (defun Get_Columns (X_List)
    ;; determine the number of columns text
    (setq Column_Qty 1
    X_List_cnt 0
    )
    (repeat (length X_List)
    ;; add a column number to List_X_Y_Text
    (setq List_X_Y_Text_Col
    (append List_X_Y_Text_Col
    (list (list
    (assoc "X coord" (nth X_List_cnt X_List))
    (assoc "Y coord" (nth X_List_cnt X_List))
    (assoc "Text" (nth X_List_cnt X_List))
    (cons "Column" Column_Qty)
    )
    )
    )
    )
    (if (/= (nth (+ X_List_cnt 1) X_List) nil)
    ;; Check for end of list
    (progn
    (if
    (>=
    (- (cdr (car (nth (+ X_List_cnt 1) X_List))) Line_Tolerance)
    (cdr (car (nth X_List_cnt X_List)))
    )
    ;; if the X Coord of the next text is out of tolerance with the current text then increase the column count
    (setq Column_Qty (1+ Column_Qty))
    )
    )
    )
    (setq X_List_cnt (1+ X_List_cnt))
    ;; index list position
    )
    ;; end repeat
    )
    ;; end Get_Columns defun
    ;;================================================ ==========================================
    (defun Get_Rows (Y_List)
    ;; determine the number of rows of text
    (setq Row_Qty 1
    Y_List_cnt
    0
    )
    (repeat (length Y_List)
    ;; add a row number to List_X_Y_Text_Col
    (setq List_All
    (append
    List_All
    (list (list ;; make a list of x, y, text, column and row
    (assoc "X coord" (nth Y_List_cnt Y_List))
    (assoc "Y coord" (nth Y_List_cnt Y_List))
    (assoc "Text" (nth Y_List_cnt Y_List))
    (assoc "Column" (nth Y_List_cnt Y_List))
    (cons "Row" Row_Qty)
    )
    )
    )
    )
    (if (/= (nth (+ Y_List_cnt 1) Y_List) nil)
    ;; Check for end of list
    (progn
    (if (<= (cdr (cadr (nth (+ Y_List_cnt 1) Y_List)))
    (- (cdr (cadr (nth Y_List_cnt Y_List))) Line_Tolerance)
    )
    ;; if the Y Coord of the next text is out of tolerance with the current text then increase the row count
    (setq Row_Qty (1+ Row_Qty))
    )
    ;; end if
    )
    ;;end progn
    )
    ;; end if
    (setq Y_List_cnt (1+ Y_List_cnt))
    ;; index list position
    )
    ;; end repeat
    )
    ;; end Get_Rows defun
    ;;================================================ ==========================================
    (defun Write_KAL_to_CSV ()
    (setq Position 0)
    (setq Path (getvar "dwgprefix"))
    ;; Obtain the file path of the drawing
    (setq Dwg_Name (substr (getvar "dwgname")
    1
    (- (strlen (getvar "dwgname")) 4)
    )
    )
    ;; remove the .dwg from the file name
    (setq KAL_CSV_File (open (strcat Path Dwg_Name " KAL.csv") "a"))
    ;; Open a CSV file for ammending
    (while (/= (nth Position List_All) nil)
    (setq Current_Row (cddr (nth Position List_All)))
    ;; setup to gather all of the same row text
    (setq Next_Row (cddr (nth (+ Position 1) List_All)))
    ;; setup to check end of row
    (while (= (cdr (assoc "Row" Current_Row))
    (cdr (assoc "Row" Next_Row))
    )
    ;; loop for all the same row
    (setq Text_Column
    (append Text_Column
    (list (list (cdr (assoc "Text" Current_Row))
    (cdr (assoc "Column" Current_Row))
    )
    )
    )
    )
    ;; create a list of text and column only
    (setq Position (1+ Position))
    ;; index position in list
    (setq Current_Row (cddr (nth Position List_All)))
    (setq Next_Row (cddr (nth (+ Position 1) List_All)))
    )
    ;; end if
    (setq Text_Column
    (append Text_Column
    (list (list (cdr (assoc "Text" Current_Row))
    (cdr (assoc "Column" Current_Row))
    )
    )
    )
    )
    ;; append Text_Column with the last text in the current row
    (setq Text_Column
    (vl-sort
    Text_Column
    (FUNCTION (LAMBDA (E1 E2) (< (cadr E1) (cadr E2))))
    )
    )
    ;; Sort list by Column number (left to right)
    (setq Column_Qty_Count
    1
    Write_Row ""
    Column_List_Position
    0
    )
    (repeat Column_Qty
    ;; repeat for the maximum number of columns
    (if (= (cadr (nth Column_List_Position Text_Column))
    Column_Qty_Count
    )
    ;; check the position of the current text's postion with the column count
    (progn ;; if equal string together the cuurent text and a comma
    (setq
    Write_Row (strcat
    Write_Row
    (car (nth Column_List_Position Text_Column))
    ","
    )
    )
    (setq Column_List_Position (1+ Column_List_Position))
    ;; index position
    )
    ;; end progn
    ;; if not equal string together previous text and a comma
    (setq Write_Row (strcat Write_Row ","))
    )
    ;; end if
    (setq Column_Qty_Count (1+ Column_Qty_Count))
    ;; index the column count
    )
    ;; end repeat
    ;;(print Write_Row)
    (write-line Write_Row KAL_CSV_File)
    ;; write the current row to the csv file
    (setq Position (1+ Position))
    ;; index list position
    (setq Text_Column nil)
    ;; reset for next row
    )
    ;; end while
    (close KAL_CSV_File)
    ;; close the csv file
    )
    ;; end Write_KAL_to_CSV defun
    ;;================================================ ==========================================
    ;; Create a CSV file from a text based Bill of Materials in AutoCAD
    (defun c:KAL (/ X_List Y_List
    Text_Column List_X_Y_Text List_X_Y_Text_Col
    List_All
    )
    (Cleanup_Text)
    (Gather_Text)
    (MakeList_X_Y_Text Text_SS)
    (Sort_by_X List_X_Y_Text)
    (setq Text_Height (cdr (assoc 40 (entget (ssname Text_SS 0)))))
    ;; get the text height used
    (setq Line_Tolerance (+ Text_Height (* Text_Height 0.1)))
    ;; set up a line spacing tolerance
    (Get_Columns X_List)
    (Sort_by_Y List_X_Y_Text_Col)
    (Get_Rows Y_List)
    (Write_KAL_to_CSV)
    )
    ;; end defun
    Attached Files

  10. #10
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,735

    Default

    Registered forum members do not see this ad.

    Please do not double post as it only leads to confusion. I believe you already have a thread about this very same problem.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

Similar Threads

  1. saveas code not working
    By WPerciful in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 6th Feb 2015, 01:48 pm
  2. code transfered from VB2008 to VB 2010 no longer working
    By dbroada in forum .NET, ObjectARX & VBA
    Replies: 12
    Last Post: 27th Mar 2013, 03:58 pm
  3. Cond.. code is not working
    By bijoyvm in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 27th May 2012, 12:43 pm
  4. SQL in lisp code
    By GemT in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 8th Aug 2007, 05:53 am
  5. got lisp code. How do I use it?
    By gib65 in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 20th Dec 2006, 03:28 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