Jump to content

Distance between points of Curve and line/intersection/s of 2 curves and dist t line.


Recommended Posts

Posted

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. :huh:

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    12

  • sinmania

    10

  • SLW210

    1

  • chuzzle

    1

Top Posters In This Topic

Posted Images

Posted

Maybe if it is .xls it will work. Because every .csv that i open is like that...

  • 5 years later...
Posted
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?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...