Multiple Constraints along Array path

Multiple Constraints along Array path

Anonymous
Not applicable
2,185 Views
9 Replies
Message 2 of 10

Multiple Constraints along Array path

Anonymous
Not applicable

Afternoon All,

 

     I am attempting to model a piece that will move along a conveyor path. It will be constrained by two hanging points. I cannot get the array path command to constraint both hanging points along the path. It will only seem to constrain the single point I click around the array. A screenshot of what I'm attempting to achieve is here, as well as a shot of the piece. Please let me know if anyone needs anything else. Sorry, I know it seems elementary, but I cannot solve this problem! Thanks in advance all!

 

 

 

array.JPGblock.JPG

 

 

0 Likes
2,186 Views
9 Replies
Replies (9)
Message 1 of 10

Anonymous
Not applicable

Afternoon All,

 

     I am attempting to model a piece that will move along a conveyor path. It will be constrained by two hanging points. I cannot get the array path command to constraint both hanging points along the path. It will only seem to constrain the single point I click around the array. A screenshot of what I'm attempting to achieve is here, as well as a shot of the piece. Please let me know if anyone needs anything else. Sorry, I know it seems elementary, but I cannot solve this problem! Thanks in advance all!

 

 

 

array.JPGblock.JPG

 

 

0 Likes
Message 3 of 10

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

Is it possible to share your drawing file too? It is a little hard for me to understand the two constraining points. it would help if I could see what you have tried already.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 4 of 10

Anonymous
Not applicable

@john.vellek, Please find a dwg attached with three sections, one where I've arrayed and constrained each one manually, one where I've attempted an array, and the original pieces.

0 Likes
Message 5 of 10

Ranjit_Singh
Advisor
Advisor

I think array allows only 1 constraint point. You will need some custom routine to add another constraint. Search the LISP forums; someone may have a routine already. Or maybe move your thread to the LISP forums and someone can write a routine.

0 Likes
Message 6 of 10

Anonymous
Not applicable
@Admin could you please move this thread to the LISP customization forum? Hopefully I can find some luck over there! Thank you in advance. (maybe @john.vellek could do this??) Have a great afternoon all!
0 Likes
Message 7 of 10

parkr4st
Advisor
Advisor

this looks like an AD Inventor problem?  Jvellek opinion?

 

if the piece is pulled by a chain to the right around a sprocket for example, only the right most pin will be hooked to the chain, the left most will be on a track to trail along around the curve?  Leftmost pin can't be pinned to the chain as the center distance will no remain the same as the chain link pin center distance's around the corner?

 

constraint the lead pin and calculate the angle of turn for an increment of travel, i.e. link length of the chain, around the corner.  the straight sections will be straight path arrays?

 

 

 

 

 

0 Likes
Message 8 of 10

Ranjit_Singh
Advisor
Advisor

I don't think multi-point constraint is available in AutoCAD. But since @john.vellek has not commented yet I maybe wrong. Meanwhile you could try the below routine. Routine generates copies of the object. Minimal testing done. see screencast on how it works. Give it a shot.

;:Ranjit Singh
;;5/22/2017
(defun c:somefunc  (/ adoc a d d1 f obj obj1 p1 p2 v)
(vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
 (setq obj  (vlax-ename->vla-object (car (entsel "\nSelect Path: ")))
       obj1 (car (entsel "\nSelect Object to follow along path: "))
       v    (mapcar 'getvar '(osmode cmdecho nomutt))
       p1   (getpoint "\nSelect constraint point 1: ")
       p2   (getpoint "\nSelect constraint point 2: ")
       d1   (getreal "\nEnter distance along path: ")
       d    (distance p1 p2)
       a    (angle p1 p2)
       f    (- (vlax-curve-getdistatparam obj (vlax-curve-getendparam obj)) d1))
 (mapcar 'setvar '(osmode cmdecho nomutt) '(0 0 1))
 (while (<= (vlax-curve-getdistatpoint obj p2) f)
  (command-s "._copy" obj1 "" p1 (setq p1 (vlax-curve-getclosestpointto obj
                                                  (vlax-curve-getpointatdist obj
                                                                             (+ d1 (vlax-curve-getdistatpoint obj (vlax-curve-getclosestpointto obj p1)))))))
  (command-s "._rotate" (setq obj1 (entlast)) "" p1 "_r" p1 (polar p1 a d) (setq p2 (somefunc2 obj p1 d))) (setq a (angle p1 p2)))
 (mapcar 'setvar '(osmode cmdecho nomutt) v)
 (vla-endundomark adoc))


(defun somefunc2  (a b c / ent rpt)
 (setq rpt (caar
            (vl-sort (vl-remove-if '(lambda (x) (minusp (cdr x)))
                                   (mapcar '(lambda (x) (cons x (- (vlax-curve-getparamatpoint a x) (vlax-curve-getparamatpoint a b))))
                                           (somefunc3
                                            (vlax-invoke a 'intersectwith (vlax-ename->vla-object (setq ent (entmakex (list '(0 . "circle") (cons 10 b) (cons 40 c))))) 0))))
                     '(lambda (x y) (< (cdr x) (cdr y))))))
 (entdel ent)
 rpt)


(defun somefunc3  (x)
 (cond ((null x) ())
       (t (cons (list (car x) (cadr x) (caddr x)) (somefunc3 (cdddr x))))))

Double_Constraint_Array.gif

Message 9 of 10

mcardonne
Community Visitor
Community Visitor

Thanks, I was looking for something like that for quite some time. 😀

0 Likes
Message 10 of 10

Sea-Haven
Mentor
Mentor

The forklift wide load. Just uses a simple get angle at point along a pline.

Fork lift.png

Nice code doing the twist in the array.

 

 

0 Likes