AutoCAD Civil 3D General Discussion

AutoCAD Civil 3D General Discussion

Reply
Valued Mentor
owenmull
Posts: 356
Registered: ‎09-06-2011
Message 1 of 31 (789 Views)
Accepted Solution

Subdivide a rectangle

789 Views, 30 Replies
10-07-2013 10:43 AM

Greetings.

 

I am wondering, does anyone have or know of a LSP routine or some easy way to take any given rectangle and divide it into "x" number of rectangles?

 

I can run a Macro to accomplish this, but ONLY if the rectangle is of the same dimensions as set up in the Macro.

 

What I am looking for is a LSP or something else that can take a rectangle of any dimension, "array" it into 64 rectangles, all having same dimensions, and said 64 rectangles making up the original, larger rectangle. The end product will resemble a grid of sorts, but I need each interior rectangle to be a closed polyline, rather than just splitting the large rectangle with gridlines.

 

Can anyone help? I can do this manually using the array command for each one, but there are several hundred that need broken up, and no time to do it in.

 

Thanks!

-Owen
Windows 7 x 64 bit
NVidia Quadro K3000M Dual Monitor
32.0 GB RAM
Intel Core i7-3820QM @ 2.70 GHz
Civil 3D 2013 SP 2
______________________________________________________________
Usually, I find that the problem is between the keyboard and the chair.
*Expert Elite*
Joe-Bouza
Posts: 4,884
Registered: ‎12-15-2008
Message 2 of 31 (784 Views)

Re: Subdivide a rectangle

10-07-2013 10:46 AM in reply to: owenmull

turn the rectangle into a parcel and set the parcel settings to the size you want

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People) Civil 3D 2012 & 2013
HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win7 OS
Valued Mentor
owenmull
Posts: 356
Registered: ‎09-06-2011
Message 3 of 31 (775 Views)

Re: Subdivide a rectangle

10-07-2013 11:03 AM in reply to: Joe-Bouza

Joe-Bouza wrote:

turn the rectangle into a parcel and set the parcel settings to the size you want


I know I can use Parcels, but I do not want to use them because I have about 500 of these to do and dont want the headache of numbering them and such. Just need them to be polys, nothing more.
-Owen
Windows 7 x 64 bit
NVidia Quadro K3000M Dual Monitor
32.0 GB RAM
Intel Core i7-3820QM @ 2.70 GHz
Civil 3D 2013 SP 2
______________________________________________________________
Usually, I find that the problem is between the keyboard and the chair.
*Expert Elite*
troma
Posts: 2,520
Registered: ‎05-21-2008
Message 4 of 31 (734 Views)

Re: Subdivide a rectangle

10-07-2013 01:53 PM in reply to: owenmull
The place for Lisp questions is:
http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/bd-p/130


Credit where credit is due! Give kudos or accept as solution whenever you can.

*Expert Elite*
mathewk
Posts: 2,746
Registered: ‎07-09-2003
Message 5 of 31 (718 Views)

Re: Subdivide a rectangle

10-07-2013 05:00 PM in reply to: owenmull

Don't worry about the numbering.  just convert them to Parcels, subdivide and then explode.  It's just so fast.

Matt Kolberg
Cansel - Autodesk Division
http://www.cansel.ca/
Valued Mentor
owenmull
Posts: 356
Registered: ‎09-06-2011
Message 6 of 31 (694 Views)

Re: Subdivide a rectangle

10-08-2013 06:36 AM in reply to: mathewk

mathewk wrote:

Don't worry about the numbering.  just convert them to Parcels, subdivide and then explode.  It's just so fast.


Again, I dont want to use parcels as I would have to manually subdivide each one. I may as well just draw them at that point.

 

Ill keep looking, thanks for the ideas, guys.

-Owen
Windows 7 x 64 bit
NVidia Quadro K3000M Dual Monitor
32.0 GB RAM
Intel Core i7-3820QM @ 2.70 GHz
Civil 3D 2013 SP 2
______________________________________________________________
Usually, I find that the problem is between the keyboard and the chair.
*Expert Elite*
Joe-Bouza
Posts: 4,884
Registered: ‎12-15-2008
Message 7 of 31 (689 Views)

Re: Subdivide a rectangle

10-08-2013 06:45 AM in reply to: owenmull
If I may as; if you had a lisp would you not have to pick something, no?

I just tested and it didn't seen too painfull. 500 plus though could be anoying, but the tool is in the box if you cant find another

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People) Civil 3D 2012 & 2013
HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win7 OS
Valued Mentor
owenmull
Posts: 356
Registered: ‎09-06-2011
Message 8 of 31 (682 Views)

Re: Subdivide a rectangle

10-08-2013 07:04 AM in reply to: Joe-Bouza

Joe-Bouza wrote:
If I may as; if you had a lisp would you not have to pick something, no?

I just tested and it didn't seen too painfull. 500 plus though could be anoying, but the tool is in the box if you cant find another


What I'm searching for is a LSP to do this. Yes, you would have to still pick the rectangle, but that is just a matter of clicking on each object once, as opposed to having to divide the rectangle, draw the interior rectangle, then array it, then explode it.

 

That's what I'm looking for.

-Owen
Windows 7 x 64 bit
NVidia Quadro K3000M Dual Monitor
32.0 GB RAM
Intel Core i7-3820QM @ 2.70 GHz
Civil 3D 2013 SP 2
______________________________________________________________
Usually, I find that the problem is between the keyboard and the chair.
Valued Mentor
TerryDotson
Posts: 483
Registered: ‎06-06-2010
Message 9 of 31 (672 Views)

Re: Subdivide a rectangle

10-08-2013 07:23 AM in reply to: owenmull

I believe the Polyline Divide tool in MapWorks Base will do what you're looking for.  It was produced to chop up PLSS sections into smaller parts and produces lines or sub-polygons.  Works on a selection set of source polylines so you would only need to select once.  The rectangle coordinates do not need to be ortho.

 

Dialog Example: http://www.dotsoft.com/images/mwPlnSubDiv.png

 

Try the 30-day full working evaluation to find out for yourself or email me one of your typical rectangles to dotson [at] dotsoft [dot] com.

Member
mw_in_okc
Posts: 3
Registered: ‎10-10-2013
Message 10 of 31 (635 Views)

Re: Subdivide a rectangle

10-10-2013 10:59 PM in reply to: owenmull

I did some research and may have come up with a viable solution for you that meets your requirements. It involves running a Python script, then copying its results to Notepad, then finally saving and running the file as a CAD script. Python is a free, open-source language typically used for automation in the GIS world, but it can be quite versatile if you think outside the box.

 

To use this custom tool, you enter:

 

- the overall rectangle width

- the overall rectangle height

- number of columns

- number of rows

 

The python script calculates the dimensions for each grid and creates coordinate lists that look like the following:

 

PLINE
0.0,0.0
80.0,0.0
80.0,80.0
0.0,80.0
C
PLINE
80.0,0.0
160.0,0.0
160.0,80.0
80.0,80.0
C
PLINE
160.0,0.0
240.0,0.0
240.0,80.0
160.0,80.0
C
PLINE
240.0,0.0
320.0,0.0
320.0,80.0
240.0,80.0
C

 

...which will result in a set of closed polylines that fill the overall area.

 

Please let me know if this works. I read that you have hundreds of these to process (which is very tedious), and just wanted to help. :-)  Change the extension back to .py

 

-Mike

Civil 3D 2013

ArcGIS 10.1

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.