Author Topic: Collaboration: Draw outline  (Read 11503 times)

0 Members and 1 Guest are viewing this topic.

T.Willey

  • Needs a day job
  • Posts: 5251
Collaboration: Draw outline
« on: April 19, 2007, 05:37:05 PM »
I'm not looking for code per say, unless someone has some that they are willing to share.  I get machine layouts done in some 3D package, maybe Acad, but they push it all down so it's a 2D drawing.  Takes up a lot of space on disk and makes the drawing slow.  I have been thinking, wishing really, about getting/creating a program that would find the outline of objects selected and create an outline of it.  So maybe it would have 42,000 objects, after running the program it will either have one polyline outline, or maybe 100 objects at most (lines arcs etc...).

I'm looking for ideas on how to start.  I'm thinking selected the objects, and the making a list of the bounding box points and the object.  Then slimming that down based on the points.

Any ideas/comments welcomed.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

LE

  • Guest
Re: Collaboration: Draw outline
« Reply #1 on: April 19, 2007, 05:39:29 PM »
Hi Tim;

Do you want to do something similar of what I did in GBPoly? or as the GBound applications?

Dinosaur

  • Guest
Re: Collaboration: Draw outline
« Reply #2 on: April 19, 2007, 05:46:52 PM »
This is not very elegant, but if I were to attempt this without a program, I would make a bounding rectangle, use bpoly in the area between the object and my rectangle, turn off the object and bpoly the resulting footprint.

EDIT

yes very much like LE's GBPOLY routine

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Collaboration: Draw outline
« Reply #3 on: April 19, 2007, 05:49:21 PM »
Hi Tim;

Do you want to do something similar of what I did in GBPoly? or as the GBound applications?
I'm not sure Luis.  Do you still have the video of it?

This is not very elegant, but if I were to attempt this without a program, I would make a bounding rectangle, use bpoly in the area between the object and my rectangle, turn off the object and bpoly the resulting footprint.

EDIT

yes very much like LE's GBPOLY routine
Maybe this would work Dino.  I haven't tried it yet.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

LE

  • Guest
Re: Collaboration: Draw outline
« Reply #4 on: April 19, 2007, 06:03:41 PM »
Here is: edit: no image available

What Dino mentioned can be an option... too.
« Last Edit: April 26, 2007, 10:17:46 AM by LE »

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Collaboration: Draw outline
« Reply #5 on: April 19, 2007, 06:20:43 PM »
YES!!!!

That is what I want to do.  What do I have to do to have something like that Luis?
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Collaboration: Draw outline
« Reply #6 on: April 19, 2007, 06:28:17 PM »
He he he...
Purchase gbpoly! :-D
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Collaboration: Draw outline
« Reply #7 on: April 19, 2007, 06:31:45 PM »
He he he...
Purchase gbpoly! :-D
Unfortunately I don't think my company would go for that since we wouldn't use it that much.  Maybe four or five times a year.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Collaboration: Draw outline
« Reply #8 on: April 19, 2007, 06:35:32 PM »
Yes, I would like a copy too but only now & then do I really need it.
It's tough to live on a budget. :-(
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

LE

  • Guest
Re: Collaboration: Draw outline
« Reply #9 on: April 19, 2007, 06:37:56 PM »
Gbpoly is not for sale unfortunately or available...


Doing one from scratch, it will be very hard ...

Give it a try... if your drawings have a lot of objects, I will not go with anyother language, just C++.


Have fun.

edit: some stuff out
« Last Edit: April 26, 2007, 10:29:33 AM by LE »

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Collaboration: Draw outline
« Reply #10 on: April 19, 2007, 06:56:27 PM »
Gbpoly is not for sale unfortunately or available... :(


Doing one from scratch, it will be very hard, unless you have a very strong knowledge in Mathematics and Geometry, it took me 5+ years developing the application.

Give it a try... if your drawings have a lot of objects, I will not go with anyother language, just C++.


Have fun.
To bad.  :oops:

I was thinking Lisp wouldn't be the most optimal language for this, but it is the one I know the most about (which isn't saying much  :wink:).

It's been awhile since I have had to do some real math, so that may take a little while to come up with.  Buy maybe it will be a fun project to work on when I have some free time now and then.

Thanks Luis.  For now maybe Dino's answer will have to do.  Will see if it will work.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Dinosaur

  • Guest
Re: Collaboration: Draw outline
« Reply #11 on: April 19, 2007, 07:11:36 PM »
. . . For now maybe Dino's answer will have to do.  Will see if it will work.

It should work, but it will definitely fail if there is a gap somewhere in the perimeter.  I use bpoly all the time to check for such gaps.

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: Collaboration: Draw outline
« Reply #12 on: April 19, 2007, 08:42:09 PM »
Luis, an excellent application, I understand how difficult that would have been to develop, well done.
Would you be able to outline the basic steps/tasks involved to perhaps kick of a community project without giving away too much that might get you in trouble :)
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Collaboration: Draw outline
« Reply #13 on: April 19, 2007, 11:36:37 PM »
Here is a simple yet effective method to do what GBPoly does using the built in AutoCAD commands in lisp. It requires command calls, and it has only been tested on 2007, so it may or may not work on other versions. No error checking .. some drawbacks identified ... feel free to modify and/or distribute ... just make sure people know where it came from ;)

If you like this code .. good .. if you don't nobody cares anyway.

above all else .. have fun

Code: [Select]
;;=============================================================
;;     getboundary.lsp by K.E. Blackie
;;            Copyright 2007
;;   by ResourceCAD International All Rights Reserved.
;;   Contact at kblackie@resourcecad.com
;;
;;    Version 1.0 April 19,2007
;;
;;   Creates a boundary surrounding a selection set of objects
;;   User windows objects to determine the item(s) to be part
;;   of the boundary.
;;=============================================================
(defun c:getboundary ( / pt1 pt2 pt3 rect)
  ; Prompt to select the first window point
  (setq pt1 (getpoint "\nSelect point: "))
  ; Prompt for the second window point
  (setq pt2 (getcorner pt1 "\nSelect Opposite corner: "))
  ; Draw a rectangle ... this could be coded better without
  ; having to call "rectangle" via command, but it works and
  ; this code is free .. so there ya go
  (vl-cmdf "rectangle" pt1 pt2)
  ; Grab the rectangle .. we need to delete it later
  (setq rect (entlast))
  ; Create a point inside the rectangle that is 1/20th the
  ; length of the hypotenuse ... if accuracy becomes a
  ; problem, changing the offset point may help. Try smaller
  ; increments if the point is consistently inside of the
  ; selected items ... alternatively, select a larger
  ; rectangle encompasing the items
  (setq pt3 (polar pt1 (angle pt1 pt2) (/(distance pt1 pt2) 20)))
  ; Use the internal "BOUNDARY" command to create a polyline
  ; boundary using the selection set within the rectangle
  (vl-cmdf "boundary" "A" "I" "Y" "O" "P" "" pt3 "")
  ; delete the original rectangle and the boundary matching
  ; the original rectangle. This could be done differently
  ; by using entdel and matching the properties of the saved
  ; rectangle from above .. but what do you expect for free huh?
  (vl-cmdf "erase" rect pt1 "")
  ; redraw the internal boundary to highlight it
  (redraw (entlast) 3)
)

<edit>
Code bombs if an ellipse is part of the selection ... to remedy this situation, change the "P" in the boundary command to "R"
« Last Edit: April 19, 2007, 11:38:44 PM by Keith™ »
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Collaboration: Draw outline
« Reply #14 on: April 20, 2007, 12:24:47 AM »
Just to clarify for anyone who wanted to use this code,
what does this mean, in a practical sense ?
Quote
;;            Copyright 2007
;;   by ResourceCAD International All Rights Reserved.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Collaboration: Draw outline
« Reply #15 on: April 20, 2007, 08:48:53 AM »
Just to clarify for anyone who wanted to use this code,
what does this mean, in a practical sense ?
Quote
;;            Copyright 2007
;;   by ResourceCAD International All Rights Reserved.

That is a silly question ... but to humor you ...

Copyright = the exclusive right to make copies, license, and otherwise exploit a literary, musical, or artistic work, whether printed, audio, video, etc.: works granted such right by law on or after January 1, 1978, are protected for the lifetime of the author or creator and for a period of 50 years after his or her death.
This right is inherent under US and most other countries laws, even if it is not included in the works.
This means ResourceCAD International owns the code and as a result has the exclusive right to license this code. Even if I had not included it in the header, I (as an agent of ResourceCAD)would still be the one who owns copyright, and legally you couldn't use it unless an agent of ResourceCAD gave you permission to use it. As an agent of ResourceCAD I have given others on theswamp that right (read the freely distribute and modify portion above) ... please read the prepending comments.

All Rights Reserved = ResourceCAD reserves all rights to this code, in its entirety. As part of the copyright owned by ResourceCAD. i.e. ResourceCAD claims its right to the code explicitly, and although not specifically required, made the notification in the code.

So, bottom line ... if you don't want to use it, then don't ... after all, I didn't write it for you anyway, I did it for Tim and CAB, both needing/wanting something similar to gbpoly.

Do you not put copyright notices in your programming?
Lets see ...
http://www.theswamp.org/index.php?topic=13916.0
http://www.theswamp.org/index.php?topic=13153.0
http://www.theswamp.org/index.php?topic=13.0
http://www.theswamp.org/index.php?topic=1915.0
http://www.theswamp.org/index.php?topic=873.0
http://www.theswamp.org/index.php?topic=950.0
http://www.theswamp.org/index.php?topic=740.0
http://www.theswamp.org/index.php?topic=9518.0
http://www.theswamp.org/index.php?topic=1553.0
http://www.theswamp.org/index.php?topic=2201.0
http://www.theswamp.org/index.php?topic=50.0
http://www.theswamp.org/index.php?topic=85.0
http://www.theswamp.org/index.php?topic=1173.0
http://www.theswamp.org/index.php?topic=5409.0
http://www.theswamp.org/index.php?topic=457.0
http://www.theswamp.org/index.php?topic=2695.0
http://www.theswamp.org/index.php?topic=601.0
http://www.theswamp.org/index.php?topic=15117.0
http://www.theswamp.org/index.php?topic=14644.0
http://www.theswamp.org/index.php?topic=15904.0
http://www.theswamp.org/index.php?topic=3628.0
http://www.theswamp.org/index.php?topic=13556.0
http://www.theswamp.org/index.php?topic=15863.0
http://www.theswamp.org/index.php?topic=13730.0
http://www.theswamp.org/index.php?topic=12984.0
http://www.theswamp.org/index.php?topic=7088.0
http://www.theswamp.org/index.php?topic=506.0
http://www.theswamp.org/index.php?topic=1231.0
http://www.theswamp.org/index.php?topic=3012.0
http://www.theswamp.org/index.php?topic=14537.0
http://www.theswamp.org/index.php?topic=2963.0
http://www.theswamp.org/index.php?topic=5521.0
http://www.theswamp.org/index.php?topic=7991.0
http://www.theswamp.org/index.php?topic=7247.0

I could post hundreds of other examples of other folks posting a copyright notice in their code right here on theswamp .. I suppose the question could be asked of them as well ... what practical purpose does it serve? After all, courts have held time and time again a copyright notice is not required to be present for a person (or entity) to exercise their rights as copyright owner.

So .. there ya go .. a whole dissertation (oh and I tried to keep it short)
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Collaboration: Draw outline
« Reply #16 on: April 20, 2007, 08:59:28 AM »
Thank you for your comments.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Collaboration: Draw outline
« Reply #17 on: April 20, 2007, 09:05:15 AM »
Thanks Keith, I'll give it a work out this afternoon.

I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Guest

  • Guest
Re: Collaboration: Draw outline
« Reply #18 on: April 20, 2007, 09:09:52 AM »
Tim: The verticals (not sure about Vanilla) have a SHRINKWRAP command (_AecLineworkShrinkwrap) that will do the same that LE's program does.


deegeecees

  • Guest
Re: Collaboration: Draw outline
« Reply #19 on: April 20, 2007, 11:03:46 AM »
Works great in Acad 04', thankyou very much Keith.

 :-)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Collaboration: Draw outline
« Reply #20 on: April 20, 2007, 11:40:09 AM »
Keith,

  Thanks for trying, but with my file the command way just doesn't want to work.  I let it sit for over ten minutes yesterday before I had to cancel the Acad session.  Maybe I will see if I can come up with some simple code (simple, yea right that even made me laugh).
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Chuck Gabriel

  • Guest
Re: Collaboration: Draw outline
« Reply #21 on: April 20, 2007, 12:09:38 PM »
Have you tried OVERKILL from the Express Tools.  I'd imagine flattening those 3d drawings results in a lot of duplicate lines and polylines sitting on top of one another.  OVERKILL might do an adequate job of getting rid of the clutter.

deegeecees

  • Guest
Re: Collaboration: Draw outline
« Reply #22 on: April 20, 2007, 12:11:06 PM »
Have you tried OVERKILL from the Express Tools.  I'd imagine flattening those 3d drawings results in a lot of duplicate lines and polylines sitting on top of one another.  OVERKILL might do an adequate job of getting rid of the clutter.

And deleting "Layer Filters" helps, along with Chucks suggestion.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Collaboration: Draw outline
« Reply #23 on: April 20, 2007, 12:16:13 PM »
Have you tried OVERKILL from the Express Tools.  I'd imagine flattening those 3d drawings results in a lot of duplicate lines and polylines sitting on top of one another.  OVERKILL might do an adequate job of getting rid of the clutter.
It is such a mess that overkill crashes Acad when I tried to do it on another drawing that I got from them, so I can't really go that route either.

And deleting "Layer Filters" helps, along with Chucks suggestion.
No layer filters within the drawing.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Chuck Gabriel

  • Guest
Re: Collaboration: Draw outline
« Reply #24 on: April 20, 2007, 12:20:51 PM »
It is such a mess that overkill crashes Acad when I tried to do it on another drawing that I got from them, so I can't really go that route either.

Man, that must be one ugly mess.  Sorry.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Collaboration: Draw outline
« Reply #25 on: April 20, 2007, 12:27:43 PM »
It is such a mess that overkill crashes Acad when I tried to do it on another drawing that I got from them, so I can't really go that route either.

Man, that must be one ugly mess.  Sorry.
The block nesting is so deep that I wrote a routine to explode all blocks until there was no blocks left within objects selected.    Here is what is returned by the routine.
Quote
Master blocks selected: 36  Total amount exploded: 1258
Went from having 41 objects within the drawing, to 55,248.  So hard to deal with when trying to clean it up.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

deegeecees

  • Guest
Re: Collaboration: Draw outline
« Reply #26 on: April 20, 2007, 12:36:28 PM »
Try xreffing as an overlay for plotting purposes, keeps alot of the individual entity data out of the drawing db at hand, if memory serves correctly.

LE

  • Guest
Re: Collaboration: Draw outline
« Reply #27 on: April 20, 2007, 01:09:11 PM »
Tim;

Do you have a drawing sample?

So in some words:

You are going to explode all the drawing, to have simple objects and from them generate an outline or footprint, when possible.... am I right/close?


I recall that MAP have some cleanup tools and the ability to create boundaries, they said better that the overkill (I never had the chance to used any of both).


LE

  • Guest
Re: Collaboration: Draw outline
« Reply #28 on: April 20, 2007, 01:15:18 PM »
Luis, an excellent application, I understand how difficult that would have been to develop, well done.
Would you be able to outline the basic steps/tasks involved to perhaps kick of a community project without giving away too much that might get you in trouble :)

Thanks,

I need to think about that possibility, sometimes I not even remember what I did yesterday, or even if I am in the living room, where my office space it is and I go for something to one of the bedrooms, and while I'm walking on the corridor, I then said to my self, myself what a heck you are doing in there?... so I go back to my office space and recall., oooh I need to ask my kids to come to eat.....  :ugly:

LE

  • Guest
Re: Collaboration: Draw outline
« Reply #29 on: April 20, 2007, 01:27:43 PM »
Tim: The verticals (not sure about Vanilla) have a SHRINKWRAP command (_AecLineworkShrinkwrap) that will do the same that LE's program does.


Hi Matt;

If you have a chance, can you try that command on the attached drawing sample, please - Also, To other swamper's, if it is possible to try using the other Ideas posted so far in this topic, Thanks!

Guest

  • Guest
Re: Collaboration: Draw outline
« Reply #30 on: April 20, 2007, 01:37:54 PM »
The attached drawing has boundaries created using Keith GetBoundary LSP program (the boundaries on the left).
The boundaries on the right were created using AutoCAD's shrinkwrap command.

LE

  • Guest
Re: Collaboration: Draw outline
« Reply #31 on: April 20, 2007, 01:44:48 PM »
Thank you for your time!

Here is attached the drawing, showing in white - what my command does - I noticed that using the shrinkwrap requires to draw some lines in order to make some closed areas - that are not, unless it does it automatically, not bad at all!

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Collaboration: Draw outline
« Reply #32 on: April 20, 2007, 02:40:38 PM »
Tim;

Do you have a drawing sample?
Can't post the drawing sorry.  And I don't think I could come up with something as complicated so easly.

So in some words:

You are going to explode all the drawing, to have simple objects and from them generate an outline or footprint, when possible.... am I right/close?


I recall that MAP have some cleanup tools and the ability to create boundaries, they said better that the overkill (I never had the chance to used any of both).


Yes that is what I was planning on doing.  I don't have map, but I guess I could download it and try some stuff.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Collaboration: Draw outline
« Reply #33 on: April 20, 2007, 04:52:13 PM »
If you google gbpoly you still see it for sale. ???
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

LE

  • Guest
Re: Collaboration: Draw outline
« Reply #34 on: April 20, 2007, 06:45:47 PM »
If you google gbpoly you still see it for sale. ???

Just updated the data, now is there a note of is not available.

Thanks.
« Last Edit: April 20, 2007, 07:38:16 PM by LE »

lamarn

  • Swamp Rat
  • Posts: 636
Re: Collaboration: Draw outline
« Reply #35 on: January 18, 2010, 08:07:15 AM »
Where can i find the _aeclineworkshrinkwrap command?
Design is something you should do with both hands. My 2d hand , my 3d hand ..

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Collaboration: Draw outline
« Reply #36 on: January 18, 2010, 09:07:48 AM »
MEP 2008 and ARCH 2008.  Not sure if it's in C3D as well.

I'm assuming it's in the latest versions of MEP and ARCH but can't verify that.
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io