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

## Recommended Posts

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
By user input in mm and draw in meter

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

Thanks

##### Share on other sites

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

3. make fillet in once by FMP.

if NO,

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

2. make fillet in once by FMP.

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

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
• 2
• 1
##### Share on other sites

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

Edited by Nikon
##### Share on other sites

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
##### Share on other sites

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.

##### Share on other sites

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

##### Share on other sites

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

Edited by BIGAL
##### Share on other sites

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

##### Share on other sites

• 2 weeks later...

Any possibility Sir

##### Share on other sites

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"))
(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)
(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

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

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.