Michaels Posted November 22, 2010 Posted November 22, 2010 Hello everybody. Is it possible to draw an Elbow 45 or 90 by the use of Entmake POLYLINE ? Any example please ? Thanking you all. Michaels Quote
Lee Mac Posted November 22, 2010 Posted November 22, 2010 You will need to calculate the bulge for the vertices of the polyline, the bulge is the tangent of 1/4 of the included angle, so for a '45' Elbow, you need a bulge of tan (pi/16) = 0.198912 Positive for anti-clockwise, negative for clockwise. Then, you are just left to calculate the positions of the vertices. Quote
Michaels Posted November 22, 2010 Author Posted November 22, 2010 Thanks Lee. I am sorry, I am not familiar with it. Have you made any example related to the same issue ? Appreciated. Quote
Lee Mac Posted November 22, 2010 Posted November 22, 2010 Create the desired LWPolyline result and look at the DXF codes (maybe use this if need be) - investigate which DXF codes control the bulge factors (I'll give you a hint.. 42) and you soon be familiar Quote
Lee Mac Posted November 22, 2010 Posted November 22, 2010 http://autodesk.com/techpubs/autocad/acad2000/dxf/lwpolyline_dxf_06.htm Quote
Michaels Posted November 22, 2010 Author Posted November 22, 2010 This is what I made a long time a go, but to make it to get the right direction , I used Rotate command with (entlast) function. So now I am looking forward to become better with coding and specially with *Polyine entmakes' functions , it makes me nervious with its much codes. (setq arc1 (getdist "\n Radious of small Elbow: ")) (setq line1(getdist "\n Width of Elbow: ")) (setq pt1 (getpoint "\n Insertion Point of Elbow: ")) (setq pt2 (list (- (car pt1) arc1)(+ (cadr pt1) arc1))) (setq pt3 (list (car pt2) (+ (cadr pt2) line1))) (setq pt4 (list (+ (car pt1) line1)(cadr pt1))) (command "_.pline" pt1 "width" 0 0 "arc" "angle" 90 pt1 pt2 "line" pt3 "arc" "angle" -90 pt4 "line" pt1 "") I am using these scripts a lot in my daily works , but to make it with entmake that would open the horizon to me to go welder . Hope you help me with it. Greatly appreciated. Quote
The Buzzard Posted November 22, 2010 Posted November 22, 2010 This is what I made a long time a go, but to make it to get the right direction , I used Rotate command with (entlast) function. So now I am looking forward to become better with coding and specially with *Polyine entmakes' functions , it makes me nervious with its much codes. (setq arc1 (getdist "\n Radious of small Elbow: ")) (setq line1(getdist "\n Width of Elbow: ")) (setq pt1 (getpoint "\n Insertion Point of Elbow: ")) (setq pt2 (list (- (car pt1) arc1)(+ (cadr pt1) arc1))) (setq pt3 (list (car pt2) (+ (cadr pt2) line1))) (setq pt4 (list (+ (car pt1) line1)(cadr pt1))) (command "_.pline" pt1 "width" 0 0 "arc" "angle" 90 pt1 pt2 "line" pt3 "arc" "angle" -90 pt4 "line" pt1 "") I am using these scripts a lot in my daily works , but to make it with entmake that would open the horizon to me to go welder . Hope you help me with it. Greatly appreciated. Michaels, The attached code addresses elbows only and is a command type code. For entmake refer to the Rectangular Mechanical DuctLisp (RMD_V6) code in my signature. That code has more than just elbows. You will need to study the codes carefully as there is alot to absorb. ELBOW.lsp Quote
Michaels Posted November 22, 2010 Author Posted November 22, 2010 Michaels, The attached code addresses elbows only and is a command type code. For entmake refer to the Rectangular Mechanical DuctLisp (RMD_V6) code in my signature. That code has more than just elbows. You will need to study the codes carefully as there is alot to absorb. You also using the command "Pline" in your routine that you uploaded. Thanks Quote
The Buzzard Posted November 22, 2010 Posted November 22, 2010 You also using the command "Pline" in your routine that you uploaded. Thanks I also mentioned in my post to look at my signature for the Duct code which is entmake. I am showing you both methods. Quote
Michaels Posted November 23, 2010 Author Posted November 23, 2010 Nobody could bring me any example ? Quote
The Buzzard Posted November 23, 2010 Posted November 23, 2010 Nobody could bring me any example ? Are you kidding? You got two examples. Quote
Michaels Posted November 23, 2010 Author Posted November 23, 2010 Are you kidding? You got two examples. Your routine that you directed me to is a complicated one which needs to read and looking for the related points to the Entmake of that Elbow. So could you please bring only the arguments of the related entmake of Polyline ? Many thanks Quote
The Buzzard Posted November 23, 2010 Posted November 23, 2010 (edited) Your routine that you directed me to is a complicated one which needs to read and looking for the related points to the Entmake of that Elbow. So could you please bring only the arguments of the related entmake of Polyline ? Many thanks Part of the learning process is to diciper someone elses code. I did mention it was alot, But the code has a road map and the functions are labled. It does' nt get much easier than that. You have also been down this road already many times before with entmake and Lee provided you with all the clues you need. You could figure this out for yourself. This code does only elbows and is entmake. I hope you get the idea this time. ELBOW2.lsp Edited November 23, 2010 by The Buzzard Removed excess angle from list Quote
Lee Mac Posted November 23, 2010 Posted November 23, 2010 Nobody could bring me any example ? Did you not follow my advice in post #2, #4, #5 ? Quote
Michaels Posted November 23, 2010 Author Posted November 23, 2010 Did you not follow my advice in post #2, #4, #5 ? Yes I did , but I did not know what to do with the (cons 42 .....) alone without a complete entmake of Polyline . Quote
Lee Mac Posted November 23, 2010 Posted November 23, 2010 Yes I did , but I did not know what to do with the (cons 42 .....) alone without a complete entmake of Polyline . Did you see how the group 42 code (bulge) relates to the vertices and my information in post #2? As far as entmaking the LWPolyline, you need to first calculate the positions of the vertices, and calculate the bulge value for each vertex (as demonstrated in post #2), then just entmake the entity using information taken from the link in post #5. You keep asking for an example but really, you already have one: just draw what you want the result to be and query the return of entget to see how the bulge relates to the vertices. Quote
Michaels Posted November 23, 2010 Author Posted November 23, 2010 Part of the learning process is to diciper someone elses code. I did mention it was alot, But the code has a road map and the functions are labled. It does' nt get much easier than that. You have also been down this road already many times before with entmake and Lee provided you with all the clues you need. You could figure this out for yourself. This code does only elbows and is entmake. I hope you get the idea this time. Thanks for your hard work for me .The Buzzard I think I have to keep on depending on the Command Reactor for my Elbows creations at the moment . Thanks a lot Quote
The Buzzard Posted November 23, 2010 Posted November 23, 2010 Thanks for your hard work for me .The Buzzard I think I have to keep on depending on the Command Reactor for my Elbows creations at the moment . Thanks a lot Do you mean command call? Why would you need to use reactors to make an elbow? The bulge factor is nothing more than an angle in radians. A straight polyline has a bulge factor of 0.0 So you will need to calculate bulge factor of the arc in the polyline. If there is something you do not understand in the code, Then please ask. You asked for an example and you got one. Try to figure it out. If there is something that needs explaining, Please let me know what it is you are stuck on. Quote
The Buzzard Posted November 23, 2010 Posted November 23, 2010 Here is a thread I started back some time when I ran into the same issue as you. Maybe this will shed some light on the subject for you. http://www.cadtutor.net/forum/showthread.php?43619-Calculate-the-bulge-of-an-arc. Also check this one at Afralisp: http://www.afralisp.net/archive/lisp/Bulges1.htm Quote
alanjt Posted November 23, 2010 Posted November 23, 2010 Did you see how the group 42 code (bulge) relates to the vertices and my information in post #2? As far as entmaking the LWPolyline, you need to first calculate the positions of the vertices, and calculate the bulge value for each vertex (as demonstrated in post #2), then just entmake the entity using information taken from the link in post #5. You keep asking for an example but really, you already have one: just draw what you want the result to be and query the return of entget to see how the bulge relates to the vertices. No one wants to do any actual homework. 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.