Author Topic: Challenge: Remove everything Outside a Title Block  (Read 2317 times)

0 Members and 1 Guest are viewing this topic.

cmwade77

  • Swamp Rat
  • Posts: 1449
Challenge: Remove everything Outside a Title Block
« on: September 27, 2011, 05:05:08 PM »
Ok, so more and more I have been finding that many of my users are placing stuff outside the title block.

So my challenge is to erase anything that is outside the title block.
Here are the requirements:
  • The title block is always in PaperSpace
  • The title block and nothing inside the boundaries of the title block can get deleted.
  • If something is even only partially outside the boundaries title block, it must get deleted.
  • The title block will generally always have the same name, but will occasionally have a different name, so an option should be provided if it does.
  • Some drawings may have more than one Layout tab in the same file, so if there is more than one layout tab, all layout tabs must be processed.
  • That being said, if a Layout tab is not initialized (i.e. the drawing was based off the default template and the Layout2 tab has not been used). It should not be processed. Better still, it should be deleted if not initialized.
  • Some projects may have different title blocks on different tabs within the same file. I would love to see this get handled as well.

I have attached my entry into this challenge, but I do not know how to check if a layout is initialized yet or not, so that part is not there.

Also, if you can make it automatically run every time the file gets saved, that is cool too, but not necessary.

Edit: I found a couple of bug in my routine, I have posted a new version.
« Last Edit: September 27, 2011, 05:21:08 PM by cmwade77 »

Jeff H

  • Needs a day job
  • Posts: 6151
Re: Challenge: Remove everything Outside a Title Block
« Reply #1 on: September 27, 2011, 05:25:54 PM »
Are .NET solutions allowed?
What you explained would not be very difficult using .NET API.
 
Here was a start of the same idea
http://www.theswamp.org/index.php?topic=38117.msg431342#msg431342

cmwade77

  • Swamp Rat
  • Posts: 1449
Re: Challenge: Remove everything Outside a Title Block
« Reply #2 on: September 27, 2011, 05:29:14 PM »
Why not? The more the merrier, although I do think LISP would be the better choice as it should run on both Mac and Windows platforms, although I don't think my example would run on Mac, but I am not sure.

kruuger

  • Swamp Rat
  • Posts: 637
Re: Challenge: Remove everything Outside a Title Block
« Reply #3 on: September 27, 2011, 05:32:10 PM »
maybe you should consider using variable LIMCHECK set to 1 ?
kruuger

cmwade77

  • Swamp Rat
  • Posts: 1449
Re: Challenge: Remove everything Outside a Title Block
« Reply #4 on: September 27, 2011, 05:34:42 PM »
maybe you should consider using variable LIMCHECK set to 1 ?
kruuger
That would work if limits were set in the drawings, generally no one bothers to set their limits these days. In addition, you cannot set limits in paperspace when paperspace margins are displayed.

Also, in doing a quick test, you cannot create objects outside the limits, but it is possible to move or copy objects outside the limits.

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: Challenge: Remove everything Outside a Title Block
« Reply #5 on: September 27, 2011, 05:37:49 PM »
Quick one, hacked together.

cmwade77

  • Swamp Rat
  • Posts: 1449
Re: Challenge: Remove everything Outside a Title Block
« Reply #6 on: September 27, 2011, 05:41:37 PM »
Lee, You never cease to amaze me. You cobbled together something in about a half an hour? It too me at least 2 hours to do mine and your code is a lot better than mine....LOL

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: Challenge: Remove everything Outside a Title Block
« Reply #7 on: September 27, 2011, 05:44:11 PM »
Lee, You never cease to amaze me. You cobbled together something in about a half an hour? It too me at least 2 hours to do mine and your code is a lot better than mine....LOL

Cheers dude  8-)  The subfunctions were already written though  :wink: