mostafajafari Posted January 27, 2009 Posted January 27, 2009 Dears Thanks all. How it can be possible to save data generated by DIMCONTINUE in to the table? Regards, MJ Quote
ReMark Posted January 27, 2009 Posted January 27, 2009 What data does DIMCONTINUE collect and what table are you trying to save it to? Quote
Lee Mac Posted January 28, 2009 Posted January 28, 2009 My Guess is that for every dimension you assign using DIMCONTINUE, you want the measurement to be possibly exported to Excel? Would I be somewhere near the mark? Quote
mostafajafari Posted January 31, 2009 Author Posted January 31, 2009 Dears Thanks Data generated by DIMCONTINUE are figures (number in mm or other units) and need to be save in to the table in order? Regards, MJ Quote
mostafajafari Posted January 31, 2009 Author Posted January 31, 2009 Dear ReMark Thanks Data generated by DIMCONTINUE are figures (number in mm or other units) and need to be save in to the table in order? Regards, MJ Quote
Lee Mac Posted January 31, 2009 Posted January 31, 2009 What table might this be then? An Excel sheet, or some table you have drawn in ACAD? Also, this is probably better accomplished using either VBA or LISP, so you might be better asking a moderator to move this thread to the AutoLISP forum. In saying that - DO NOT create another thread in that forum, ask to get this one moved - it gets confusing if you have two identical threads in different forums. Cheers Lee Quote
mostafajafari Posted January 31, 2009 Author Posted January 31, 2009 Dear Lee Mac Thanks. I prefer to save data in an Excel sheet, but it would be OK in any other form of table! Regards, MJ Quote
Lee Mac Posted January 31, 2009 Posted January 31, 2009 This should work: (defun c:exdim (/ *error* oldvars varlist entLst file ofile) (vl-load-com) (defun *error* (msg) (if oldvars (mapcar 'setvar varlist oldvars)) (if (= msg "") (princ "\n< Function Complete >") (princ (strcat "\nError: " (strcase msg)))) (princ)) (setq varlist (list "CMDECHO") oldvars (mapcar 'getvar varlist)) (setvar "cmdecho" 0) (prompt "\nSelect Base Dimension > ") (command "_dimcontinue" "S") (while (> (getvar "CMDACTIVE") 0) (command pause) (setq entLst (cons (entlast) entLst))) (setq entLst (reverse (cddr entLst))) (if (setq file (getfiled "Create or Select an Excel File" "C:\\" "csv" 9)) (progn (setq ofile (open file "w")) (foreach e entLst (write-line (rtos (cdr (assoc 42 (entget e))) 2 2) ofile)) (close ofile)) (princ "\nNo File Selected")) (*error* "") (princ)) Quote
mostafajafari Posted February 2, 2009 Author Posted February 2, 2009 Dear Lee Mac Thanks! I tried the "program", but I couldn't get the results. It may comes from my improperly use! If you possibly could give instruction of use its great help to me. Regards, MJ Quote
Lee Mac Posted February 2, 2009 Posted February 2, 2009 The program should work if used correctly - I have tested it myself. To be used as follows: Copy the contents of the code frame into an empty notepad doc, and save as something.lsp (make sure the option is set to "all files"). Go to Load application in ACAD (or type _appload into command prompt) and find the saved lisp file. Type exdim into command prompt Select a Dimension on which to use dim-continue. Once dimensioning is completed, create/select an excel file (.csv) to write to. Open csv file to view results. Quote
Lee Mac Posted February 2, 2009 Posted February 2, 2009 See attached for method of use and results: ExDim.zip test.zip Quote
mostafajafari Posted February 4, 2009 Author Posted February 4, 2009 Dear Lee Mac Thanks! Best regards, MJ Lee McDonnell.pdf Quote
mostafajafari Posted February 7, 2009 Author Posted February 7, 2009 Dear Lee Hi, I am happy to hear your laughing! Just one point, data created in DIMCONTINUE are in 4 decimal digits but transferred figures in Excel are in 2 decimal digits! Cheers, MJ Quote
Lee Mac Posted February 7, 2009 Posted February 7, 2009 Data created is now printed to 4 dp: (defun c:exdim (/ *error* oldvars varlist entLst file ofile) (vl-load-com) (defun *error* (msg) (if oldvars (mapcar 'setvar varlist oldvars)) (if (= msg "") (princ "\n< Function Complete >") (princ (strcat "\nError: " (strcase msg)))) (princ)) (setq varlist (list "CMDECHO") oldvars (mapcar 'getvar varlist)) (setvar "cmdecho" 0) (prompt "\nSelect Base Dimension > ") (command "_dimcontinue" "S") (while (> (getvar "CMDACTIVE") 0) (command pause) (setq entLst (cons (entlast) entLst))) (setq entLst (reverse (cddr entLst))) (if (setq file (getfiled "Create or Select an Excel File" "C:\\" "csv" 9)) (progn (setq ofile (open file "w")) (foreach e entLst (write-line (rtos (cdr (assoc 42 (entget e))) 2 4) ofile)) (close ofile)) (princ "\nNo File Selected")) (*error* "") (princ)) Quote
mostafajafari Posted February 8, 2009 Author Posted February 8, 2009 Thanks Lee There is sometimes "zero" value in figures generated in DIMCONTINUE! (Perhaps because when line dimension is smaller than a certain amount?). We need figures, even in very small unit. Regards, MJ Quote
Lee Mac Posted February 8, 2009 Posted February 8, 2009 OK then: (defun c:exdim (/ *error* oldvars varlist entLst file ofile) (vl-load-com) (defun *error* (msg) (if oldvars (mapcar 'setvar varlist oldvars)) (if (= msg "") (princ "\n< Function Complete >") (princ (strcat "\nError: " (strcase msg)))) (princ)) (setq varlist (list "CMDECHO") oldvars (mapcar 'getvar varlist)) (setvar "cmdecho" 0) (prompt "\nSelect Base Dimension > ") (command "_dimcontinue" "S") (while (> (getvar "CMDACTIVE") 0) (command pause) (setq entLst (cons (entlast) entLst))) (setq entLst (reverse (cddr entLst))) (if (setq file (getfiled "Create or Select an Excel File" "C:\\" "csv" 9)) (progn (setq ofile (open file "w")) (foreach e entLst (write-line (rtos (cdr (assoc 42 (entget e)))) ofile)) (close ofile)) (princ "\nNo File Selected")) (*error* "") (princ)) Quote
Phiphi Posted February 9, 2009 Posted February 9, 2009 OK then: (defun c:exdim (/ *error* oldvars varlist entLst file ofile) (vl-load-com) (defun *error* (msg) (if oldvars (mapcar 'setvar varlist oldvars)) (if (= msg "") (princ "\n< Function Complete >") (princ (strcat "\nError: " (strcase msg)))) (princ)) (setq varlist (list "CMDECHO") oldvars (mapcar 'getvar varlist)) (setvar "cmdecho" 0) (prompt "\nSelect Base Dimension > ") (command "_dimcontinue" "S") (while (> (getvar "CMDACTIVE") 0) (command pause) (setq entLst (cons (entlast) entLst))) (setq entLst (reverse (cddr entLst))) (if (setq file (getfiled "Create or Select an Excel File" "C:\\" "csv" 9)) (progn (setq ofile (open file "w")) (foreach e entLst (write-line (rtos (cdr (assoc 42 (entget e)))) ofile)) (close ofile)) (princ "\nNo File Selected")) (*error* "") (princ)) Thanks Lee Mac, but can you add an option to save dim text in Rows or Columns please. Quote
Lee Mac Posted February 9, 2009 Posted February 9, 2009 Will see what I can do when I get a bit of time Quote
Lee Mac Posted February 9, 2009 Posted February 9, 2009 This provides the option for Column Delimited: (defun c:exdim (/ *error* oldvars varlist entLst file ans ofile) (vl-load-com) (defun *error* (msg) (if oldvars (mapcar 'setvar varlist oldvars)) (if (= msg "") (princ "\n< Function Complete >") (princ (strcat "\nError: " (strcase msg)))) (princ)) (setq varlist (list "CMDECHO") oldvars (mapcar 'getvar varlist)) (setvar "cmdecho" 0) (prompt "\nSelect Base Dimension > ") (command "_dimcontinue" "S") (while (> (getvar "CMDACTIVE") 0) (command pause) (setq entLst (cons (entlast) entLst))) (setq entLst (reverse (cddr entLst))) (if (setq file (getfiled "Create or Select an Excel File" "C:\\" "csv" 9)) (progn (setq ofile (open file "w")) (initget 1 "Rows Columns") (setq ans (getkword "\nRow or Column Delimited? ")) (cond ((= ans "Rows") (foreach e entLst (write-line (rtos (cdr (assoc 42 (entget e)))) ofile))) ((= ans "Columns") (setq entLst (apply 'strcat (mapcar '(lambda (d) (strcat (rtos (cdr (assoc 42 (entget d)))) (chr 44))) entLst))) (write-line entLst ofile))) (close ofile)) (princ "\nNo File Selected")) (*error* "") (princ)) 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.