Author Topic: Anyone up for a LISP challenge?  (Read 2036 times)

0 Members and 1 Guest are viewing this topic.

R_rogerD

  • Guest
Anyone up for a LISP challenge?
« on: July 27, 2015, 02:43:35 PM »
Hi,
 
Here's one for all you budding LISP writers, if you fancy a challenge.......?  :-)
 
Auto-delete overlapping text.
 
In the past I have looked at addressing the drawing as a whole and all text on all layers using some form of weighting. However, I feel this may be too complicated. Instead, I suggest addressing a layer at a time.
 
The way I see it is:
- user isolates layer
- user selects multiple text entries on that layer
- the routine would then:
- gives all text items a label as 't1' 't2' 't3' etc
- draws bounding boxes around all text entries
- selects text item 't1'
- create a search area around text 't1' of radii 2x size of bounding box
- name every piece of text within this search as 's1' 's2' 's3' s4' etc
- check each in turn to see if bounding box of 's1' overlaps with box of 't1'
- if 's1' overlaps with 't1' then delete 's1'. If not, ignore
- if 's2' overlaps with 't1' then delete 's2'. if not, ignore
- repeat for all 's' items.
- return to main loop and check for item 't2'.
- repeat until all entries in selection have been checked.
 
I think that this is how it would work. I just haven't a clue how to write LISP.
 
What do ya think?
 
BIG thanks!
 
Rroger_D

JohnK

  • Administrator
  • Seagull
  • Posts: 10643
Re: Anyone up for a LISP challenge?
« Reply #1 on: July 27, 2015, 02:52:38 PM »
Please note (long version): a "Challenge" here at theSwamp is usually as a "contest" or "race" of speed, better code, etc. among other lispers. They are buckets of fun! Your subject line isn't very descriptive towards your programming problem and could be misinterpreted by those who regularly take part in those challenges and be "disappointed" this post was not a "challenge" they were expecting. In other words, you may not get the help you want (as fast as, or as nicely put as...) because people will read the title and expect something else.

TLDR: Change your title to be more descriptive towards your problem and you may get more help.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org


Jeff H

  • Needs a day job
  • Posts: 6150
Re: Anyone up for a LISP challenge?
« Reply #3 on: July 27, 2015, 04:30:12 PM »
It's on.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Anyone up for a LISP challenge?
« Reply #4 on: July 27, 2015, 04:34:03 PM »
TSPACEINVADERS

hmspe

  • Bull Frog
  • Posts: 362
Re: Anyone up for a LISP challenge?
« Reply #5 on: July 27, 2015, 06:33:41 PM »
Your description makes some sense up until you start deleting text.  I can understand doing something to highlight places in the drawing where text overlaps to make it easy to find, but I can't imagine having a lisp routine arbitrarily erase text.  How could a routine possibly know which text string is more important?
"Science is the belief in the ignorance of experts." - Richard Feynman

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Anyone up for a LISP challenge?
« Reply #6 on: July 27, 2015, 06:46:28 PM »
I stopped reading after the second line in the OP.

Then Jeff's poster caught my eye ...
so I came here to say 'very pretty'
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.