PDA

View Full Version : AutoLISP Triming everything on one side of a line



Fleybovich
22nd Jun 2010, 03:13 pm
I am looking a way to trim everything sticking out on one side of a line, and if possible select lines that need to be all extended to the other side of the line. I am working on a really large file that needs a lot of editing with trim on one side of the line and extending all the line on the other side of the line. If anybody can help i would really really appreciate it.

Thank You

alanjt
22nd Jun 2010, 03:17 pm
Express Tools: EXTrim

Fleybovich
22nd Jun 2010, 03:28 pm
Im not sure how that command works because i tried it and it still left a few things untrimed even tho when i use the trim command it gets trimmed

alanjt
22nd Jun 2010, 03:32 pm
21125...........

Fleybovich
22nd Jun 2010, 03:55 pm
oh wow thank you so much, i finally figured it with your help. Nice Video!

Do you have any ideas of how i can make a messy file with many lines overlapping into a clean file with zero lines overlapping?

I also attached a jpg of the drawing that im working on and i am trying to make the edges of the street blocks straight because they were imported using another program and they came out very crooked. Do you have an easy method of doing this?

Right now i am trimming away and i only showed you a small clip of the whole drawing. There are line 15-20 blocks with about 45-60 lots on each block.

If you have any idea how i can make this process go faster i would greatly appreciate it.

Thanks for the help

Feliks

Freerefill
22nd Jun 2010, 04:21 pm
I do this sort of stuff at my work (road edges, lot lines, etc) and from my experience, it's best to just accept that it'll never be straight :P I think most of that data is obtained by satellite or from ancient records, and I seriously doubt anyone who had a hand in creating the file cared much about making nice neat straight lines that looked super pretty. For what it's worth, it irks me to no end as well. :P

If you absolutely must make them straight, you could draw a polyline or xline to approximate it, and then manually move all the points to that line, or just use that line to trim out the spots that are screwy. There may be some complex way of speeding up that process, but I wouldn't know how. The only other thing I could think to suggest would be to re-think how you're importing it, but that's a long shot.

alanjt
22nd Jun 2010, 04:25 pm
I agree. GIS, etc. data is just ugly as hell.

This is the best I could come up with:

21129

Freerefill
22nd Jun 2010, 04:27 pm
How'd you manage that, Alan? I struggled for days trying to figure out a linear least squares formula (the ultimate goal was to get it done for a circle, but I still can't figure that one out).

alanjt
22nd Jun 2010, 04:32 pm
It's doesn't do anything fancy like that. It just removes all interior segments, so the LWPolyline is a single segment curve.

What're you trying to do? I'm not fully understanding.

Fleybovich
22nd Jun 2010, 04:34 pm
Really thats funny that you have to do the same. Well the only problem with accepting it is that after i import all the lots and streets and road etc. i have to hatch each item seperately, the roads, the building footprints, and the streets. To do that i need some kinda of boundary and its really difficult to get an easy boundary from the imported files. Anyways if you have any idea about hatching it easier let me know

alanjt
22nd Jun 2010, 04:36 pm
Really thats funny that you have to do the same. Well the only problem with accepting it is that after i import all the lots and streets and road etc. i have to hatch each item seperately, the roads, the building footprints, and the streets. To do that i need some kinda of boundary and its really difficult to get an easy boundary from the imported files. Anyways if you have any idea about hatching it easier let me knowWBlock out a section and post it. We'll figure something out.

Freerefill
22nd Jun 2010, 04:36 pm
The GIS data I use has all the lots as individual closed polylines, not sure if OP uses the same. It's like lining a bunch of rectangles up, then moving their vertices around to make that squiggly shape, then trying to line them back up. I'd show you with a neat little .gif image but I don't know how you guys do those. o.o

alanjt
22nd Jun 2010, 04:37 pm
Found it. This may be interesting for simplifying polylines

http://www.theswamp.org/index.php?topic=19865.0

alanjt
22nd Jun 2010, 04:38 pm
The GIS data I use has all the lots as individual closed polylines, not sure if OP uses the same. It's like lining a bunch of rectangles up, then moving their vertices around to make that squiggly shape, then trying to line them back up. I'd show you with a neat little .gif image but I don't know how you guys do those. o.oSounds like typical GIS data. I use Camtasia, BTW.

alanjt
22nd Jun 2010, 04:43 pm
Mark, did you want the routine?

Freerefill
22nd Jun 2010, 04:46 pm
No thanks, Alan. I just wanted to know if you had some mystical powers over the LLS method. If you did, I would have picked your brain to get a circle out of it :P. Thanks though, and thanks for letting me know about that .gif program. :)

alanjt
22nd Jun 2010, 04:49 pm
No thanks, Alan. I just wanted to know if you had some mystical powers over the LLS method. If you did, I would have picked your brain to get a circle out of it :P. Thanks though, and thanks for letting me know about that .gif program. :)Didn't think so. I'm not sure what use it would have. I know I'll never use it. I don't know anything about LLS, so you'd have to help me out with that you are trying to accomplish before I can help. However, if it's math, Lee/Gile are the guys to talk to. I'm taking Calc-1 next semester. So that should give you and idea of my math level.