Jump to content

Recommended Posts

Posted

My error the code for the above should be:

 

(defun c:profiles5ft (/ ent1 ent2 i len pt p1 ptlst1 ptlst2 ptlst3 ptlst4)
(vl-load-com)

(set'one 5)

(if (and (setq ent1 (car (entsel "\nSelect First Polyline: ")))
(wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE"))
(if (and (setq ent2 (car (entsel "\nSelect Second Polyline: ")))
(wcmatch (cdr (assoc 0 (entget ent2))) "*POLYLINE"))
(progn
(setq i -1 len (/ (vla-get-Length
(vlax-ename->vla-object ent1)) 100.))
(while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len)))
(setq p1 (vlax-curve-getClosestPointto ent2 pt t)
ptlst1 (cons (polar pt (angle pt p1) (/ (distance pt p1) one.)) ptlst1)))
(setq ptlst1 (apply 'append
(mapcar
(function
(lambda (x)
(list (car x) (cadr x)))) ptlst1)))
(vla-AddLightWeightPolyline
(vla-get-ModelSpace
(vla-get-ActiveDocument
(vlax-get-acad-object)))
(vlax-make-variant
(vlax-safearray-fill
(vlax-make-safearray
vlax-VBDouble (cons 0 (1- (length ptlst1)))) ptlst1))))))

(set'two 2.5)

(if (and (setq ent1 (car (entsel "\nSelect First Polyline: ")))
(wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE"))
(if (and (setq ent2 (car (entsel "\nSelect Second Polyline: ")))
(wcmatch (cdr (assoc 0 (entget ent2))) "*POLYLINE"))
(progn
(setq i -1 len (/ (vla-get-Length
(vlax-ename->vla-object ent1)) 100.))
(while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len)))
(setq p1 (vlax-curve-getClosestPointto ent2 pt t)
ptlst2 (cons (polar pt (angle pt p1) (/ (distance pt p1) two.)) ptlst2)))
(setq ptlst2 (apply 'append
(mapcar
(function
(lambda (x)
(list (car x) (cadr x)))) ptlst2)))
(vla-AddLightWeightPolyline
(vla-get-ModelSpace
(vla-get-ActiveDocument
(vlax-get-acad-object)))
(vlax-make-variant
(vlax-safearray-fill
(vlax-make-safearray
vlax-VBDouble (cons 0 (1- (length ptlst2)))) ptlst2))))))

(set'three 1.66)

(if (and (setq ent1 (car (entsel "\nSelect First Polyline: ")))
(wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE"))
(if (and (setq ent2 (car (entsel "\nSelect Second Polyline: ")))
(wcmatch (cdr (assoc 0 (entget ent2))) "*POLYLINE"))
(progn
(setq i -1 len (/ (vla-get-Length
(vlax-ename->vla-object ent1)) 100.))
(while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len)))
(setq p1 (vlax-curve-getClosestPointto ent2 pt t)
ptlst3 (cons (polar pt (angle pt p1) (/ (distance pt p1) three.)) ptlst3)))
(setq ptlst3 (apply 'append
(mapcar
(function
(lambda (x)
(list (car x) (cadr x)))) ptlst3)))
(vla-AddLightWeightPolyline
(vla-get-ModelSpace
(vla-get-ActiveDocument
(vlax-get-acad-object)))
(vlax-make-variant
(vlax-safearray-fill
(vlax-make-safearray
vlax-VBDouble (cons 0 (1- (length ptlst3)))) ptlst3))))))

(set'four 1.25)

(if (and (setq ent1 (car (entsel "\nSelect First Polyline: ")))
(wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE"))
(if (and (setq ent2 (car (entsel "\nSelect Second Polyline: ")))
(wcmatch (cdr (assoc 0 (entget ent2))) "*POLYLINE"))
(progn
(setq i -1 len (/ (vla-get-Length
(vlax-ename->vla-object ent1)) 100.))
(while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len)))
(setq p1 (vlax-curve-getClosestPointto ent2 pt t)
ptlst4 (cons (polar pt (angle pt p1) (/ (distance pt p1) four.)) ptlst4)))
(setq ptlst4 (apply 'append
(mapcar
(function
(lambda (x)
(list (car x) (cadr x)))) ptlst4)))
(vla-AddLightWeightPolyline
(vla-get-ModelSpace
(vla-get-ActiveDocument
(vlax-get-acad-object)))
(vlax-make-variant
(vlax-safearray-fill
(vlax-make-safearray
vlax-VBDouble (cons 0 (1- (length ptlst4)))) ptlst4))))))

(princ))

  • 2 years later...
Posted

Hi, is there a CPoly equivalent for Autocad for Mac?

Thank you!

  • 2 years later...
Posted

Lee, can you create a LISP for me: polyline, .040 thick, dashed, 4 cliks, layer 0, green color. I will use it as AVB membrane. Thanks 

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