Author Topic: Collaboration: Draw outline  (Read 11508 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.