Demesne Posted July 9, 2010 Posted July 9, 2010 Lee Mac: Thanks but that only seems to connect with a 2D Polyline. I was looking for a 3D polyline to connect points with varying z values. Quote
Demesne Posted July 9, 2010 Posted July 9, 2010 It is a 3dPolyline. When you list a 2d or 3dpolyline, it will just say 'Polyline'. Ahhh! I see. Quote
alanjt Posted July 9, 2010 Posted July 9, 2010 My ride is late... (defun c:OC (/ _sel lst pt line) ;; Connect objects (by insertion point) ;; Alan J. Thompson, 05.22.10 (vl-load-com) (defun _sel (pnt msg / gr e pt) (while (and (setq gr (grread T 15 2)) (/= (car gr) 25) (not (vl-position (cadr gr) '(13 158))) (not e) ) (redraw) (and pnt (grdraw (trans pnt 0 1) (cadr gr) 1 -1)) (princ (strcat "\r" msg)) (if (and (eq 3 (car gr)) (setq e (ssget (cadr gr))) (setq e (entget (ssname e 0))) (not (wcmatch (cdr (assoc 0 e)) "*LINE*,ARC,*TEXT*")) (setq pt (cdr (assoc 10 e))) ) pt (setq e nil) ) ) ) (if (car (setq lst (list (_sel nil "Select object: ")))) (while (setq pt (_sel (car lst) "Select next object: ")) (if (equal pt (car lst)) (alert "Same object as previous!") (if line (vla-put-coordinates line (AT:PointList->Array (apply (function append) (reverse (setq lst (cons pt lst))))) ) (setq line (vla-Add3DPoly (AT:ActiveSpace) (AT:PointList->Array (apply (function append) (reverse (setq lst (cons pt lst)))) ) ) ) ) ) ) ) (redraw) (princ) ) (defun AT:PointList->Array (lst) ;; Convert point list (must be appended first) to array ;; Alan J. Thompson, 09.16.09 (if (vl-consp lst) (vlax-Make-Variant (vlax-SafeArray-Fill (vlax-Make-SafeArray vlax-vbDouble (cons 0 (- (length lst) 1))) lst) ) ) ) (defun AT:ActiveSpace (/) ;; Defined ActiveSpace ;; Alan J. Thompson, 10.12.09 (if (or (eq acmodelspace (vla-get-activespace (cond (*AcadDoc*) ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) ) ) ) (eq :vlax-true (vla-get-mspace *AcadDoc*)) ) (vla-get-modelspace *AcadDoc*) (vla-get-paperspace *AcadDoc*) ) ) 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.