Jump to content

Splitting drawing in 1000x1000 unit drawings and clean them up...?


t.freriks

Recommended Posts

Hi all!

 

If read post http://www.cadtutor.net/forum/showthread.php?t=35391&highlight=split over and over and over again, but my Lisp knowledge is way too bad, to use and change that script for my use. It teaches me a lot, but when I want to change just one line, it keeps bugging me with errors.

 

That's why I think I need your help!

 

Here's my problem:

 

I have lots and lots of (Dutch) topographic drawings wich sometimes overlap, but all of them are drawn in the same Dutch grid (a grid x,y with the central 0,0 near Paris). I need to 'cut' them all in seperate drawings of 1000x1000 units (=meters) with a filename like: gXXXYYY.dwg where XXX is the first three coordinate numbers of X and the same for YYY.

Then there is another problem. If two original drawings 'overlap', the Lisp routine should not 'make' a new drawing, bat 'add' that part to the already made file, then 'Remove Double Lines' if neccessary.

 

 

Here is what I think the script should do:

 

  • - Ask the user in which folder all the drawings are which should be split
  • - Ask the user where to put the new splitted files (another folder!)
  • - Open the first drawing:
    • - Find Extmin and Extmax
    • - Draw a grid (it can be done with a block called 'border' like here But then the block should first be made within the script!) over the entire drawing from Extmin till Extmax with squares of 1000x1000 units (meters)
    • - Loop through all the squares:
      • select (crossing) each square an make a Wblock of it, named: gXXXYYY.dwg. (Only if there is content within the square!)
      • Note: if the gXXXYYY.dwg already exists, it should not make a new file (overwrite) but ADD the new content to the existing file.
      • Open the Wblock gXXXYYY.dwg file
      • 'Extrim' everything outsite the square
      • delete the square so only the original content is in the new file
      • explode all the other blocks in the gXXXYYY.dwg file (as many times as neccessery) so no blocks are left
      • purge everything within that file (also .shp & .shx tex/shape styles if possible)
      • Put everything which is not in a layer called "TOPO aangepast" into a layer "TOPO" (create it, if it doesn't already exist layer color of "TOPO" = 8). So all the content of layer "TOPO aangepast" is unchanged, all the rest should be in the layer "TOPO" and put to "color by layer"
      • Re-save drawing gXXXYYY.dwg

      [*]Go to the next square and do all above things again untill all squares are saved en cleaned up

    [*]Go to the next drawing in the folder the user chose, and do all of the above on all drawings of that folder

Well, I think that 'bout says it all. I might think it would be too complex, or too much work for you guys to program it all, but maybe you guys (girls) could give me a good start? :oops:

 

If you write some code, please add some explanations within it so I can read an if nessecary adjust it.

 

Thanx for your time to read this... maybe someone can help?

 

Thomas

The Netherlands :geek:

Link to comment
Share on other sites

Mate what you ask is quite a lengthy task, particualy the reopen and add part to a dwg.

 

May i suggest you email leemac, He now provides a servise

Link to comment
Share on other sites

This is a lot of work, and there are some parts of your request which would be pretty difficult to achieve (like the "Adding" to the existing drawings), but the most part I think can be done.

 

with this much work involved, I'd be surprised if someone would provide this for free, but if you drop me an email or PM, I'm sure we can come to some sort of arrangement :)

 

Lee

Link to comment
Share on other sites

...but if you drop me an email or PM, I'm sure we can come to some sort of arrangement :)

 

Lee

 

Ehhmm... cannot find out where to PM you! :cry:

 

Thomas

Link to comment
Share on other sites

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