Jump to content

Single pline to multi line with radius+start and end close


Recommended Posts

Posted

Dear members, I need a lisp to convert single pline to multi  close pline , 
for rebar purpose please see attached image thanks

By layer: layer name - Bar01

: T =thickness
: R= radius 
By user input in mm and draw in meter

 

Or if have any other trick or program please share with me

 

Thanks 

IMG-20231031-WA0004.jpg

Posted (edited)

If the R value of the inner and outer lines is the same, it's width is different in curve.

Is it sure that picture you want?

 

if YES, and T is smaller than R, you can use this routine.

1. set global width of polyline to T, by properties window (ctrl+1)

2. get outline of polylines by MPOLYOUTLINE

http://www.lee-mac.com/polyoutline.html

3. make fillet in once by FMP.

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-multiple-polyline-all-at-once-by-lisp/m-p/6473166/highlight/true#M343470

 

if NO,

1. set global width of polyline to T, by properties window (ctrl+1)

2. make fillet in once by FMP.

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-multiple-polyline-all-at-once-by-lisp/m-p/6473166/highlight/true#M343470

3. get outline of polylines by MPOLYOUTLINE. (link is different from the one above.)

http://www.lee-mac.com/advpolyoutline.html

It is more advanced version of MPOLYOUTLINE, because it recognizes arcs, 

but it is difficult to execute on complex drawings.

so before execution, the drawing must be simply organized.

 

Edited by exceed
  • Like 2
  • Thanks 1
Posted (edited)

The bending radius depends on the diameter of the armature, 
and the inner and outer diameters of the bent rod are different.

2 LISP programs for rounding rods depending on the diameter and class of fittings.
Аnd Dynamic block G-mod. details ∅10-32Dynamic block G-mod.details ∅10-32.zip

Image 1.png

Edited by Nikon
Posted (edited)

Ignoring the radius thing highlighted above (assume this was just a quick sketch and you'd not set the inner radius differently)

 

I assume that these are 2 segment rebars though the codes should work for many bends?

Fillet the polyline segments with radius r (r being the outer radius?)

Offset inwards by thickness t (the radius will now be (r - t) )

Join the ends together as one polyline

 

 

 

Let us know if the drawn lines ('single lines') are the outside edge, inner edge or centre of the rebar and if the radius is the inner as on the sketch. Also are there defaults for the radius and thickness that can be preset into the LISP... and then it should be fairly easy to make up.

Edited by Steven P
  • Like 1
Posted

For some reo bars there is a simple rad=Bar dia * value. This could be put in as a default value for rad once dia is entered.

Posted
On 11/1/2023 at 6:09 PM, Steven P said:

Ignoring the radius thing highlighted above (assume this was just a quick sketch and you'd not set the inner radius differently)

 

I assume that these are 2 segment rebars though the codes should work for many bends?

Fillet the polyline segments with radius r (r being the outer radius?)

Offset inwards by thickness t (the radius will now be (r - t) )

Join the ends together as one polyline

 

 

 

Let us know if the drawn lines ('single lines') are the outside edge, inner edge or centre of the rebar and if the radius is the inner as on the sketch. Also are there defaults for the radius and thickness that can be preset into the LISP... and then it should be fairly easy to make up.

 Currently I require only for 2 segment only, and possibility also for more segments/bends.

 

Q- Fillet the polyline segments with radius r (r being the outer radius?)

Ans- Yes , currently use outer R will be less than T.(T>R)

 

Q- Join the ends together as one polyline.

Ans- Yes

 

Q-Let us know if the drawn lines ('single lines') are the outside edge.

Ans- that is inner edge , Yes I need offset above the single polyline.

 

Thanks 

 

Posted (edited)

Only missing answer what is radius formula ? eg Bar thickness * 12 normally based on centreline or inner radius.

Edited by BIGAL
  • Like 1
Posted
On 11/7/2023 at 3:42 AM, BIGAL said:

Only missing answer what is radius formula ? eg Bar thickness * 12 normally based on centreline or inner radius.

Sir, Based on center line, currently assume R =T/3.

 

Thanks 

 

 

  • 2 weeks later...
Posted (edited)

Try this, I have reset the radius as T/3 is not suitable.

 

; https://www.cadtutor.net/forum/topic/78583-single-pline-to-multi-line-with-radiusstart-and-end-close/

(defun c:test ( / bar barsz ent ent1 ent2 ent3 ent4 off1 off2 st1 st2 end1 end2 obj)
(setq bar (list "Please choose" "6" "8" "10" "12" "14" "16" "18" "20" "22" "25" "28" "32" "36" "40"))
(if (not AH:Butts)(load "Multi Radio buttons.lsp"))
(setq barsz (atof (ah:butts 1 "v" bar)))
(setq ent (car (entsel "\nChoose bar pline ")))
(setq obj (vlax-ename->vla-object ent))
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)
(setvar 'filletrad (* barsz 4))
(command "fillet" "P" ent )
(vla-offset obj (/ barsz 2.0))
(setq ent1 (entlast))
(setq off1 (vlax-ename->vla-object ent1 ))
(vla-offset obj (- (/ barsz 2.0)))
(setq ent2 (entlast))
(setq off2 (vlax-ename->vla-object ent2))
(setq st1 (vlax-curve-getstartPoint off1))
(setq end1 (vlax-curve-getEndPoint off1))
(setq st2 (vlax-curve-getstartPoint off2))
(setq end2 (vlax-curve-getEndPoint off2))
(command "line" st1 st2 "")
(setq ent3 (entlast))
(command "line" end1 end2 "")
(setq ent4 (entlast))
(command "pedit" ent1 "Join" ent3 ent2 ent4 "" "exit")
(entdel ent)
(setvar 'osmode oldsnap)
(princ)
)
(c:test)

 

Edited by BIGAL
  • Like 2
  • 10 months later...
Posted

Dear @BIGALError is coming,

Load failed: "multi radio buttons.lsp"

 

Thanks 

Posted

Thanks sir, working perfectly 

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