JONTHEPOPE Posted November 17, 2008 Posted November 17, 2008 that ive got a real old lisp that could use a look at can some one please help me configure / update this lisp -i bet it's a keeper- one file was .bmp not sure what that mean's hope someone can help! thanks guys Quote
JONTHEPOPE Posted November 17, 2008 Author Posted November 17, 2008 ;;; Table.lsp ;;; ;;; Permission to use, copy, modify, and distribute this software and its ;;; documentation for any purpose and without fee is hereby granted. ;;; ;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ;;; ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF ;;; MERCHANTABILITY ARE HEREBY DISCLAIMED. ;;; ;;; Copyright© Roy Everitt ;;; February, 2000 ;;; ;;; Note: Older versions of Autocad will not recognize the *error* function. You will ;;; need to replace the (defun-q *error* (msg) statement with (defun *error* (msg). ;;; ;;; Generate a Table or Chart using a combination of the "dimtxt" and "dimscale" ;;; settings from the Autocad drawing to determine the appropriate table text sizes. ;;; The only known limitations for the size of table (I.E. number of rows and ;;; number of columns) is the input dialogs. Generally, depending on the size of ;;; your monitor and the screen resolution settings, a 10 X 10 matrix, (default) will not ;;; exceed Autocad's ability to build the edit box dialogs and display them for input. ;;; Keep this in mind if you get any dialog errors. Try smaller row and column input ;;; combinations, until you can determine what your system's display limitation is. ;;; The 10 X 10 matrix limit established from the popup list can be increased to whatever ;;; your preferences might be, by adjusting the popup list values in the "set_row" & ;;; "set_col" functions. ;;; The edit_box defaults for row and column inputs have been set to an edit_width of ;;; (7) and an edit_limit of (20). You can adjust these settings to enhance the dialog ;;; input capabilities for various screen size and resolution limitations as well. ;;; The program gives you the ability to input the (body) of matrix text, by using the ;;; tab key, (by default), to step through row and column input. ;;; For those who prefer to input the (body) of matrix text, by columns, the program will ;;; also allow you to step through input by columns. Place the cursor at the top of each ;;; column, then use the return (enter) key to move down to the next row for input. ;;; ;;; The program also generates a custom DCL file (temp.dcl) that is re-written each ;;; time it is executed. The code may be changed so that temp.dcl is written to, and ;;; found in any user preferred folder, as long as that folder is in the Support Files ;;; Search Path. ;;; Note: By default, it will be written in your Autocad Working Directory, (wherever ;;; your shortcut or "Start In" Icon is set up to work). ;;; Example: Look for the code: (setq fd (open "temp.dcl" "w")) ;;; Change it to: (setq fd (open "c:\\myfolder\\temp.dcl" "w")) ;;; Look for the code: (close (open "temp.dcl" "w") ) ;;; Change it to: (close (open "c:\\myfolder\\temp.dcl" "w") ) ;;; Look for the code: (if (< (setq *Tableid* (load_dialog "temp.dcl")) 0) ;;; Change it to: (if (< (setq *Tableid* (load_dialog "c:\\myfolder\\temp.dcl")) 0) ;;; (Where "myfolder" is your designated folder name) ;;;================================================================================= (princ "\Table program loading...") (defun C:TABLE (/ CR DLG_CLOSE DLG_HEADER DLG_DIALOG DLG_ITEM DLG_PROTO DLG_ATT SYMTOS DCL_TEMP DCL_MATRIX DCL_MATRIX_HED SET_COL GET_COL SET_ROW GET_ROW GET_QTY CHECK_NEXT SET_NEXT_MATRIX_ITEM TOGG_ASSOC OL OS OC DLG_MAIN DELETE_TEMP_DCL DLG_MATRIX DLG_MATRIX_HEAD GET_MATRIX GET_MATRIX_HEAD DRAW_TABLE DRAW_TABLE_HEAD *TABLEID* FD ROW_NDX COL_NDX COL_QTY COL_NUM COL_INPUT NO_OF_COLS ROW_QTY ROW_NUM ROW_INPUT NO_OF_ROWS FLAG NEXT_MATRIX TOG_VALUE INCL DCL_ID TITLE DS OSMODE CECOLOR CLAYER SCALE SIZE HALFSIZE TITLESIZE SP CNT TOTAL_WIDTH TOTAL_HEIGHT ) ;;;;;Main dialog control functions;;;; (defun CR () (princ "\n" FD)) (defun DLG_CLOSE () (princ "}" FD) (CR)) (defun DLG_HEADER (AUDIT) (princ "dcl_settings : default_dcl_settings {" FD) (CR) (princ (strcat " audit_level = " (itoa AUDIT) "; }") FD) (CR) ) ;_ end of defun (defun DLG_DIALOG (NAME) (princ (strcat NAME " : dialog {") FD) (CR)) (defun DLG_ITEM (ITEM) (princ (strcat ": " ITEM "{") FD) (CR)) (defun DLG_PROTO (type) (princ (strcat type ";") FD) (CR)) (defun DLG_ATT (ATT VAL) (cond ((= (type VAL) 'INT) (princ (strcat ATT "=" (itoa VAL) ";") FD) (CR) ) ((= (type VAL) 'REAL) (princ (strcat ATT "=" (rtos VAL) ";") FD) (CR) ) ((= (type VAL) 'STR) (princ (strcat ATT "=\"" VAL "\";") FD) (CR) ) ((= (type VAL) 'SYM) (princ (strcat ATT "=" (SYMTOS VAL) ";") FD) (CR) ) ) ;_ end of cond ) ;_ end of defun (defun SYMTOS (SYM / FD) (setq FD (open "symtos.txt" "w")) (princ SYM FD) (close FD) (setq FD (open "symtos.txt" "r") SYM (strcase (read-line FD) t) ) ;_ end of setq (close FD) SYM ) ;_ end of defun (defun DCL_TEMP (/ FD) (setq FD (open "temp.dcl" "w")) (DLG_HEADER 0) ;;;Define Main Dialog;;; (DLG_DIALOG "dlg_main") (DLG_ATT "label" "Table Matrix Selection") (DLG_ITEM "text_part") (DLG_ATT "label" "Include a Table Title Heading ?") (DLG_ATT "alignment" 'CENTERED) (DLG_CLOSE) (DLG_ITEM "toggle") (DLG_ATT "fixed_width" 'TRUE) (DLG_ATT "alignment" 'CENTERED) (DLG_ATT "key" "togg") (DLG_CLOSE) (DLG_ITEM "boxed_column") (DLG_ATT "label" "Select the Number of Columns") (DLG_ITEM "popup_list") (DLG_ATT "alignment" 'CENTERED) (DLG_ATT "width" 5) (DLG_ATT "key" "col_qty") (DLG_ATT "fixed_width" 'TRUE) (DLG_CLOSE) (DLG_CLOSE) (DLG_ITEM "boxed_column") (DLG_ATT "label" "Select the Number of Rows") (DLG_ITEM "popup_list") (DLG_ATT "alignment" 'CENTERED) (DLG_ATT "width" 5) (DLG_ATT "key" "row_qty") (DLG_ATT "fixed_width" 'TRUE) (DLG_CLOSE) (DLG_CLOSE) (DLG_ITEM "button") (DLG_ATT "key" "get_qty") (DLG_ATT "label" "Input Table Information") (DLG_ATT "alignment" 'CENTERED) (DLG_ATT "fixed_width" 'TRUE) (DLG_ATT "height" 3) (DLG_CLOSE) (DLG_PROTO "spacer_1") (DLG_PROTO "cancel_button") (DLG_CLOSE) (close FD) "temp.dcl" ) ;_ end of defun (defun DCL_MATRIX (/ FD) (setq FD (open "temp.dcl" "w")) (DLG_HEADER 0) ;;;define Table matrix dialog;;; (DLG_DIALOG "dlg_matrix") (DLG_ATT "label" "Table Matrix Input (NO Title Heading)") (DLG_ITEM "boxed_column") (DLG_ATT "label" "Table Matrix Input (Includes Column Headings)") (setq ROW_NDX 1) (repeat NO_OF_ROWS (DLG_ITEM "row") (setq COL_NDX 1) (repeat NO_OF_COLS (DLG_ITEM "edit_box") (DLG_ATT "key" (strcat "row" (itoa ROW_NDX) "col" (itoa COL_NDX)) ) ;_ end of dlg_att (DLG_ATT "edit_width" 7) (DLG_ATT "edit_limit" 20) (DLG_CLOSE) (setq COL_NDX (1+ COL_NDX)) ) ;_ end of repeat (DLG_CLOSE) (setq ROW_NDX (1+ ROW_NDX)) ) ;_ end of repeat (DLG_CLOSE) (DLG_ITEM "button") (DLG_ATT "fixed_width" 'TRUE) (DLG_ATT "height" 3) (DLG_ATT "alignment" 'CENTERED) (DLG_ATT "key" "do_Table") (DLG_ATT "label" "Complete the Table") (DLG_CLOSE) (DLG_PROTO "cancel_button") (DLG_ATT "alignment" 'CENTERED) (DLG_CLOSE) (close FD) "temp.dcl" ) ;_ end of defun (defun DCL_MATRIX_HEAD (/ FD) (setq FD (open "temp.dcl" "w")) (DLG_HEADER 0) ;;;define Table Matrix_head dialog;;; (DLG_DIALOG "dlg_matrix_head") (DLG_ATT "label" "Table Matrix Input with Title Heading") (DLG_ITEM "text_part") (DLG_ATT "label" "Table Title Heading") (DLG_ATT "alignment" 'CENTERED) (DLG_ATT "fixed_width" 'TRUE) (DLG_CLOSE) (DLG_ITEM "edit_box") (DLG_ATT "key" "title") (DLG_ATT "edit_width" (* NO_OF_COLS 7)) (DLG_ATT "edit_limit" (* NO_OF_COLS 20)) (DLG_ATT "alignment" 'CENTERED) (DLG_ATT "fixed_width" 'TRUE) (DLG_CLOSE) (DLG_ITEM "boxed_column") (DLG_ATT "label" "Table Matrix Input (Includes Column Headings)") (setq ROW_NDX 1) (repeat NO_OF_ROWS (DLG_ITEM "row") (setq COL_NDX 1) (repeat NO_OF_COLS (DLG_ITEM "edit_box") (DLG_ATT "key" (strcat "row" (itoa ROW_NDX) "col" (itoa COL_NDX)) Quote
JONTHEPOPE Posted November 17, 2008 Author Posted November 17, 2008 here's the cod please help with bmp file:shock: ?? table.zip Quote
JONTHEPOPE Posted November 17, 2008 Author Posted November 17, 2008 Once you get to 2004, shouldn't you just use the built in table command? (I think that's the version it was introduced in). i found this quote on the internet i guess i should resherch my post a little first Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.