Tutorial: Modeling and Animating a 4-bar Linkage with AutoCAD

Sdílet
Vložit
  • čas přidán 11. 09. 2024
  • How to model a 4-bar linkage in AutoCAD using blocks and parametric constraints. A VLISP program is used to animate the end result. Here's a listing of the animationrotation vlisp program. Note that CZcams does not permit the use of the "less than" symbol (left point "V" ). Be sure to edit the line with the WHILE statement by changing ??? to the less than symbol.
    (defun c:animaterotation (/)
    ; L. Minardi 12/22/2017 v1.0
    ; Animates a group about a specified point. User may specify:
    ; - center point of rotation
    ; - group name
    ; - rotation angle step size
    ; - delay factor for each step
    ; - number of steps in the animation
    (setq ctr (getpoint "
    Indicate center of rotation."))
    (setq AngStep (getreal "
    Enter angle step size (10): "))
    (if (= AngStep nil) (setq AngStep 10))
    (setq d (getint "
    Enter delay factor (100): "))
    (if (= d nil) (setq d 100))
    (setq gname (getstring "
    Enter group name (g1): "))
    (if (= gname "") (setq gname "g1"))
    (setq nSteps (getint "
    Enter number of steps (20): "))
    (if (= nSteps nil) (setq nSteps 20))
    (setq i 0 )
    (while (??? i nSteps) ; -------------------------------------- replace ??? with the "less than" symbol.
    (command "rotate" "g" gname "" ctr AngStep nSteps)
    (setq i (1+ i))
    (command "delay" d)
    ) ; end while
    (princ)
    )

Komentáře • 56

  • @TETOYVIENDO
    @TETOYVIENDO Před 3 lety +1

    B R A V O!!! (standing ovation)

  • @allancohen
    @allancohen Před 2 lety

    Genius! Precisely what I needed!

  • @b_gumm
    @b_gumm Před 5 měsíci

    Excellent work!

  • @agll1156
    @agll1156 Před 3 lety

    Thank you! Excellent video tutorial!!

  • @davestephens8617
    @davestephens8617 Před 6 měsíci

    Very good video, thanks

  • @carlsoltau3627
    @carlsoltau3627 Před 5 měsíci

    How can I connect the lines with the object itself. When I merge the moving lines, the object does not move?

    • @LeeMinardi
      @LeeMinardi  Před 5 měsíci

      As noted in the tutorial each link is a block. Are you familiar with AutoCAD blocks? Each of the blocks have a line on the xy plane whose ends are referenced when applyng the coincident constraint. The 3D solid part of the link is a solid object on a different layer of the same block as the lines. Since the reference lines are part of the same block as the "object" they move together.
      Please let me know if you require further explanation with specifics about what is unclear.

  • @NukleusMiguno
    @NukleusMiguno Před 2 lety

    Thank you so much, it help me alot..

  • @brotherhood3331
    @brotherhood3331 Před 4 lety

    Thank you for you video it helped me very much

  • @andrewmerafuentes6683
    @andrewmerafuentes6683 Před 4 lety

    Thank you so much. Big help.

  • @barryking5342
    @barryking5342 Před rokem

    Hey Lee, this works great, thanks so much! I can use it for training my aviation maintenance students on flight controls and ???. One bug so far, when trying different parameters for smoother action such as step size 1 degree, time delay 20 and steps 360 (a full circle) it sometimes crashes and becomes nonresponsive. Any ideas? Are there limits beyond which we should not push those parameters

    • @LeeMinardi
      @LeeMinardi  Před rokem

      Hi Barry, I'm glad you found the program useful. It's possible to create 4 bar linkages where the crank cannot rotate 360 degrees. Could that be the issue? What were the dimensions for the linkage that caused the program to crash? Please state: the distance between the pivots, the length of the crank located at one of the pivots, the length of the link connected to the other pivot and the length of the couple link.

  • @manzidankelly3874
    @manzidankelly3874 Před rokem

    Hey. For the AnimateRotation programme what sofiware do you have to use? Or it is just a notepad?

    • @LeeMinardi
      @LeeMinardi  Před rokem

      In AutoCAD go to the Manage tab then click Visual LISP Editor, File, New File and type in the program. Save the file as AnimateRotation (.scr will be appended automatically).
      Click Tools, Load text in Editor or give the Script command in AutoCAD to load the program. After it is loaded you can run the AnimateRotation command like any other command.

  • @bogest76
    @bogest76 Před 4 lety

    Thank you Sir!

  • @bruce13ish
    @bruce13ish Před 5 lety

    I'm trying apply constraints to prove how a set of joints will operate.
    I have 2 lines, both at 0 on the Z axis, and I have the ucs positioned on one of the lines. When I try to apply a coincident restraint I'm getting the following messages.
    GCCOINCIDENT
    Select first point or [Object/Autoconstrain] :
    Select second point or [Object] :
    The constraint cannot be applied. The two objects must reside in the same plane.
    Can you suggest a solution?

    • @LeeMinardi
      @LeeMinardi  Před 5 lety

      First, set the UCS to World
      UCS [Enter][Enter]
      Give the list command and select the first line and check that the z coordinate for both ends are = 0.0
      Do the same for the other line. This will validate that the two lines lie on the z = 0 plane (not axis as you state).
      If you want to work with two lines that are on the same plane but the plane is skewed in space then set the UCS such that the XY plane of the UCS contains the two lines.

  • @RickyVg7
    @RickyVg7 Před 2 lety

    Hi! When I try to do the "Coincident" part, only the line moves to the fixed point but the solid remains on its position. What am I doing wrong? :c

    • @LeeMinardi
      @LeeMinardi  Před 2 lety +2

      Each link is an AutoCAD BLOCK with a solid object on one layer and a line on another layer. The line is referenced for applying the coincident constraint. I mention this at 0:16 in the video. Since the line and the solid are components of the same block they will move together. Does this answer your question?

    • @RickyVg7
      @RickyVg7 Před 2 lety

      @@LeeMinardi YES! Thank you. I didn't know what a BLOCK was hahaha I appreciate it ;)

    • @py.engineering
      @py.engineering Před 2 lety

      @@LeeMinardi But, do you have a video to learn how to link a solid with a line. Even if they are circles with some kind or rounded solids, how can I know how? Please, help me!

  • @ymautomation3983
    @ymautomation3983 Před 2 lety

    Thank you 💕💕💕💕 boss

  • @mohsin160
    @mohsin160 Před 5 lety

    Hello,
    The bars you made are blocks or you simply used press pull to get the bars?
    Regards

    • @LeeMinardi
      @LeeMinardi  Před 5 lety +1

      AutoCAD’s parametric features can only reference point, lines, arcs, circles, and splines on a 2D plane. It cannot reference solids. I therefore created the links as individual block objects. Each block includes lines on the XY plane and, on a separate layer, a solid representation of the link (0:20 in video). When adding a coincident parametric constraint the line ends in the block are referenced.
      The solid objects that are in a block were created by making a 2D outline drawing of the link with circles (holes) for the “pivot” points (the center of the holes line up with the ends of the lines). The 2D shape of the link was created by converting the outline and holes to regions and then subtracting the holes. The resulting region was then extruded into a solid.

    • @mohsin160
      @mohsin160 Před 5 lety

      If possible, can you share the CAD file in which you are working....?

    • @LeeMinardi
      @LeeMinardi  Před 5 lety

      @@mohsin160 I've posted it on the AutoCAD forum in response to your original post.

  • @DorinHirte
    @DorinHirte Před 4 lety

    can you make small video, how you link the lines to solids, ore this seams to by the only missing info. couple of seconds for the video beginning

  • @frdriiic
    @frdriiic Před 2 lety

    Is this possible to get the lsp file to do this rotation?

    • @LeeMinardi
      @LeeMinardi  Před 2 lety

      I've added a listing of the program to the description paragraph. Before using it be sure to make the noted change for the "less than" symbol.

    • @frdriiic
      @frdriiic Před 2 lety

      @@LeeMinardi Thanks a lot!

  • @jagadeshsan7480
    @jagadeshsan7480 Před 4 lety

    Is it possible to rotate chain and gears sir?

    • @LeeMinardi
      @LeeMinardi  Před 4 lety

      A chain wrapped around a gear like on a bicycle would be difficult as each individual link of the chain would need to be animated individually. A few gears could be done.

  • @AC3DCad
    @AC3DCad Před 6 lety

    could you pls do more animation in autocad . By the way, thanks for this video

    • @LeeMinardi
      @LeeMinardi  Před 6 lety

      You are welcome AC 3DCad. What kind of AutoCAD animation would you like to see? Unlike 3ds Max where I do most of my animations, AutoCAD is quite limited but there are workarounds.

    • @pratikraut8005
      @pratikraut8005 Před 3 lety

      ​@@LeeMinardiwheels rotating on a circular track

  • @tabrejkhan6592
    @tabrejkhan6592 Před rokem

    nice

  • @danyCD17
    @danyCD17 Před 6 lety

    How did you make the bars attach on top of one another?

    • @LeeMinardi
      @LeeMinardi  Před 6 lety +1

      Each block of the different bars of the mechanism has a line on the xy plane that was used for applying the coincident constraint. The solid objects of the bars was created at different z values so that the bars do not interfere with each other. The bottom of the solid objects for the crank and follower have a z value of 0 while the coupler has a z value equal to the thickness of the bars. The pivots are just below the xy plane. I mention this at 0:34 in the video.

    • @danyCD17
      @danyCD17 Před 6 lety

      @@LeeMinardi oh, I get it now, thanks for the fast response

  • @arfatahmed9019
    @arfatahmed9019 Před 4 lety

    how you converted these
    lines into solid part

    • @LeeMinardi
      @LeeMinardi  Před 4 lety +1

      Each link in the mechanism is a separate AutoCAD block that contains a line on the xy plane and a solid model representation of the link on a separate layer of the block.
      Are you asking how to create solid objects in AutoCAD?

  • @virenramchandani6113
    @virenramchandani6113 Před 6 lety

    how did you attach a line to a object in Autocad ??? ref : 0:25

    • @LeeMinardi
      @LeeMinardi  Před 6 lety +1

      I created a different block for each of the links and the pivot. The lines you see at 0:25 are part of the blocks but on a different layer. The lines are all on the zero XY plane (Z=0) to ensure a planar mechanism. If all your geometry were 2D the lines would not be necessary as you could add the coincident constraint between links by snapping to the center of the circles that define the link ends.

    • @virenramchandani6113
      @virenramchandani6113 Před 6 lety

      Lee Minardi thank you !!! 👍👍

    • @dwaraganathanrengasamy6169
      @dwaraganathanrengasamy6169 Před 4 lety

      @@LeeMinardi I have a solid and a line. How to apply constrain to them.. like you did. I am unable to lock them together. Please reply early and help me finish my project🥺

    • @LeeMinardi
      @LeeMinardi  Před 4 lety +1

      @@dwaraganathanrengasamy6169 The line and solid for each link are part of the same block as explained at about 20 seconds into the video. The lines for each block lie on the XY plane (z = 0). The solid component of the block lies above or below the Z = 0 plane. The lines and solids are on different layer. Parametric constraints only work in 2D. You are really constraining the lines of the blocks not the solids. The solid object are there to make the final mechanism look good!
      I hope this answers your question. Good luck!

    • @andrewmerafuentes6683
      @andrewmerafuentes6683 Před 4 lety

      Thanks.

  • @royalbertbernal6901
    @royalbertbernal6901 Před 4 lety

    ANIMATEROTATION is unknown command? How can i use that on autocad2015? Thanks IDOL! LODI!

    • @LeeMinardi
      @LeeMinardi  Před 4 lety

      animaterotation is a vlisp program. You must load it before using it. Below is a listing for the program that is shown at the end of the video. Save this program as a text file with the filename extension .lsp. In AutoCAD give the command _appload and then you will be able to give the command animaterotation.
      (defun c:animaterotation (/ ctr AngStep d gname nSteps i)
      ; L. Minardi 1/11/2018 v1.0
      ; Animates a group about a specified point. User may specify:
      ; - center point of rotation
      ; - group name
      ; - rotation angle step size
      ; - delay factor for each step
      ; - number of steps in the animation
      (setq ctr (getpoint "
      Indicate center of rotation."))
      (setq AngStep (getreal "
      Enter angle step size (10): "))
      (if (= AngStep nil) (setq AngStep 10))
      (setq d (getint "
      Enter delay factor (100): "))
      (if (= d nil) (setq d 100))
      (setq gname (getstring "
      Enter group name (g1): "))
      (if (= gname "") (setq gname "g1"))
      (setq nSteps (getint "
      Enter number of steps (20): "))
      (if (= nSteps nil) (setq nSteps 20))
      (setvar "CMDECHO" 0)
      (setq i 0 )
      (while (< i nSteps)
      (command "rotate" "g" gname "" ctr AngStep nSteps)
      (setq i (1+ i))
      (command "delay" d)
      ) ; end while
      (setvar "CMDECHO" 1)
      (princ)
      ) ; end defun

    • @andrewmerafuentes6683
      @andrewmerafuentes6683 Před 4 lety

      Please enlighten me the steps to load this program. How do I save it, which directory to save it? I badly need this. Please help.

    • @andrewmerafuentes6683
      @andrewmerafuentes6683 Před 4 lety

      Successfully loaded it. Thanks.