Lisp to create multiple boundaries at once from polylines

Lisp to create multiple boundaries at once from polylines

cjones99HU5
Explorer Explorer
3,046 Views
10 Replies
Message 1 of 11

Lisp to create multiple boundaries at once from polylines

cjones99HU5
Explorer
Explorer

I am in need of a lisp(if it is possible) that will create multiple boundaries at once from closed rectangles.  I do not need them to be hatched.

0 Likes
3,047 Views
10 Replies
Replies (10)
Message 2 of 11

pbejse
Mentor
Mentor

@cjones99HU5 wrote:

I am in need of a lisp(if it is possible) that will create multiple boundaries at once from closed rectangles.  I do not need them to be hatched.


How's that again? That can be interpreted in so many different ways.

Can you please show an illustration? or even an AutoCAD sample drawing of before and after?

 

As an aside: 

A moderator or an AI of some sort should be able to check the posted question for clarity,  similar to what stackoverflow have on their forum, but more intelligent.

 

 

Message 3 of 11

cjones99HU5
Explorer
Explorer

Paver_snip.PNG

Each of those pinkish lines needs to be an independent boundary.  I have a road project that I need all the roads split into sections and am hoping somebody knows of a shortcut to create multiple boundaries all at once as opposed to me selecting 3 at a time and then repeating this for however long it would take.

 

0 Likes
Message 4 of 11

hak_vz
Advisor
Advisor

@cjones99HU5 

 

Here is your code. I hope this is what you are looking for. If it works Accept is as a solution.

 

 

(defun c:mbdry (/ ss lst tlst)
(princ "\nSelect entities to create mutual boundaries >")
(setq ss (ssget) lst (entlast) tlst lst)
(setvar 'cmdecho 0)
(command "_region" ss "")
(setq ss (ssadd))
(while (setq lst (entnext lst)) (setq ss (ssadd lst ss)))
(command "_.union" ss "")
(command "_.explode" ss)
(setq ss (ssadd) lst tlst)
(while (setq lst (entnext lst)) (setq ss (ssadd lst ss)))
(command "_pedit" "m" ss "" "y" "j" "" "")
(setvar 'cmdecho 1)
(princ)
)

 

Attach dwg sample that helps us to create code. Always give detailed explanation and attach sample with what you have and what you want to achieve with lisp code.

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 5 of 11

cjones99HU5
Explorer
Explorer
I feel as though it should work, but when I select the entities it never gives me another command to move on from selection. I will mess around with it a little longer to see if I can figure it out. Nonetheless, I appreciate it!
0 Likes
Message 6 of 11

hak_vz
Advisor
Advisor

Attach dwg sample. I have a filling that it won't work. If works in case that you have set of overlapping closed entities like polylines, circles an similar. In your case that is not the case.

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 7 of 11

hak_vz
Advisor
Advisor

You can simply use command "bpoly" or "boundary". Hide road center-line, run command and pick point inside each region, and you'll get closed rectangles.  

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 8 of 11

cjones99HU5
Explorer
Explorer

This is what I have been doing, but I was hoping for a way to select multiple regions at once and turn them into boundaries.

For example what we are trying to do is we have 20,000 ft of roadway that we want to create sample polygons of 100 ft intervals.  We have GIS road centerlines that we have offset with polylines to represent both pavement edges and then we inserted a line perpendicular to the centerline, intersecting the "edge of pavement", at 100 ft intervals throughout the entirety of the roadways.  

0 Likes
Message 9 of 11

ronjonp
Advisor
Advisor

Might be worth the investment: https://www.superboundary.com/

0 Likes
Message 10 of 11

Sea-Haven
Mentor
Mentor

The request for 100' intervals can be done pretty easy as suggested pick cl then turn it off, do 100' lines sq off c/l then trim back to left and right edge. Do bpoly at 50 ft interval with select point being on the c/l pline hopefully all done, note start and end look open so bpoly may not work may need a start at 150' same for end dont do last, join ends then do bpoly.

 

Is this some form of civil thing not sure why 40 years civil experience.

0 Likes
Message 11 of 11

john.uhden
Mentor
Mentor

@cjones99HU5 

I am not writing the code, but thinking out loud...

1.  Offset the edges of the road to a different layer from C/L.

2.  Array your cross section lines along the C/L path at 100' intervals plus the beginning and the end

3.  Freeze the C/L layer.

4.  Use vlax-curve-getpointatdist along the C/L path at every 100' (starting from the first one at 50'),

    and at each point run the BOUNDARY command.

5.  You'll have to account for the last piece that probably won't end at an even 100'.

 

I'm a civil too, and have no idea what purpose this would serve.

John F. Uhden

0 Likes