Lee Mac Posted May 11, 2009 Posted May 11, 2009 I can't understand why the cells aren't being separated - it works perfectly on my machine, and yet, it is still being exported to a csv on yours... so I can't see whats different. Quote
sinmania Posted May 14, 2009 Author Posted May 14, 2009 Maybe if it is .xls it will work. Because every .csv that i open is like that... Quote
chuzzle Posted September 20, 2014 Posted September 20, 2014 For deletion of dimension lines: (defun c:CurvInt (/ doc spc ss i j 1L oPt cEnt cObj Int iLst pt dObjlst) (vl-load-com) (setq doc (vla-get-ActiveDocument (vlax-get-Acad-Object)) spc (if (zerop (vla-get-activespace doc)) (if (= (vla-get-mspace doc) :vlax-true) (vla-get-modelspace doc) (vla-get-paperspace doc)) (vla-get-modelspace doc))) (setq file (getfiled "\nSelect Location for Excel File" (if def_file def_file "") "csv" 1)) (if (not (setq def_file file)) (exit)) (prompt "\nSelect Vertical Lines...") (if (setq ss (ssget (list (cons 0 "LINE,*POLYLINE") (if (getvar "CTAB") (cons 410 (getvar "CTAB")) (cons 67 (- 1 (getvar "TILEMODE"))))))) (progn (setq oFile (open file "w") i 0 j 1 1L (chr 44)) (while (<= (setq i (1+ i)) (sslength ss)) (setq 1L (strcat 1L (itoa i) (chr 44)))) (write-line 1L oFile) (setq oPt (getpoint "\nSpecify Origin <0,0,0> : ")) (or oPt (setq oPt '(0 0 0))) (while (and (setq cEnt (car (entsel "\nSelect Curve to Measure: "))) (member (cdr (assoc 0 (entget cEnt))) '("LINE" "LWPOLYLINE" "POLYLINE" "SPLINE" "ARC"))) (setq cObj (vlax-ename->vla-object cEnt)) (foreach Obj (vl-sort (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))) '(lambda (x1 x2) (< (car (vlax-curve-getStartPoint x1)) (car (vlax-curve-getStartPoint x2))))) (setq Int (vlax-invoke cObj 'IntersectWith Obj acExtendNone)) (if Int (progn (setq iLst (cons (- (car Int) (car oPt)) iLst) pt (list (car Int) (cadr Int) (caddr Int))) (setq dObjlst (cons (vla-addDimRotated spc (vlax-3D-point pt) (vlax-3D-point (list (car pt) (cadr oPt) 0)) (vlax-3D-point pt) (/ pi 2)) dObjlst)) (setq dObjlst (cons (vla-addDimRotated spc (vlax-3D-point pt) (vlax-3D-point (list (car oPt) (cadr pt) 0)) (vlax-3D-point pt) 0) dObjlst))) (setq iLst (cons 0.0 iLst)))) (write-line (strcat "Curve " (itoa j) (chr 44) (Pnt->Csv iLst)) oFile) (setq j (1+ j) iLst nil) (initget "Yes No") (if (not (eq "No" (getkword "\nDelete Old Dimensions? [Yes/No] <Yes>: "))) (mapcar 'vla-delete dObjlst)) (setq dObjlst nil)) (close oFile)) (princ "\n<!> No Lines/*Polylines Selected <!>")) (princ)) (defun Pnt->Csv (lst / Str) (setq Str "") (while lst (setq Str (strcat (rtos (car lst)) (chr 44) Str) lst (cdr lst))) Str) Hi all, I also want to use this routine. But I just want to measure the vertical distance from a horizontal line at points generated on it by common interval to a curve. The result is also exported to csv file. Please tell me how to do it? Thanks. By the way, could someone please tell me in detail how to use the above routine? 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.