Author Topic: AutoLISP routine help!!!! (by collegeCAD)  (Read 41402 times)

0 Members and 1 Guest are viewing this topic.

SMadsen

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #45 on: October 02, 2003, 09:02:13 AM »
Yeah yeah, AFTER you changed to ENTMAKE I'm sure!  heh

Seriously, would you mind run AddLayers on your machine with 12450 layers?  I hate to admit it, but this is an OLD 500 MHz (don't laugh .. ok, laugh .. I do!) PIII thingy.

t-bear

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #46 on: October 02, 2003, 02:50:52 PM »
Man, this is AWSOME!  We loaded all three routines here and tried 'em all out....Stig, yours won.  The guys like the prefix ability....Mark, yours is great too. Daron...hate to say this, but I ran yours with 30 layers then, after a purge, with 10.  got 30 .... seems to have locked into that # for some reason.?
Now for part 2)  
My drafter would like something similar, but with the ability to cycle through, oh say, 8 pre-determined colours.
01 = blue
02 = red
03 = magenta.....
get the picture?
He would like to be able to set the colors in the code...that way if he needed to he could open the file and edit there.....
Any ideas?

Oh, Sig....understand that I'm real stupid, OK?  Yours sets a default prefix to DIM...how do i get it to make the layers without a prefix?....01..02..03..etc...?
Am going to play with these for a bit.

Fellas...you are GODS among lesser-mortals.....Thank you VERY MUCH!!!!

daron

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #47 on: October 02, 2003, 03:07:26 PM »
Quote from: t-bear
Daron...hate to say this, but I ran yours with 30 layers then, after a purge, with 10.  got 30 .... seems to have locked into that # for some reason.?
Not a problem T. As I stated before, I took what was there and modified it to your request. I guess it depends on the machine, because I was able to put up 30 layers no problem. Now, you'll see the race shows that mine folded on 12450 layer or less. That's the problem with not using the database the way Stig or Mark did. If I wanted to create anew, mine would've resembled Mark's more or less. I'm glad I did what I did. It is a great tool to show the progamming community that there is a right way and a wrong way to do things, even though all cases can work to an extent.

Quote from: t-bear
I ran yours with 30 layers then, after a purge, with 10. got 30 .... seems to have locked into that # for some reason.?

At a quick glance, I can't see why, but you don't want to use mine anyway. Use Stig's, it's proven.

t-bear

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #48 on: October 02, 2003, 04:46:37 PM »
Daron....
Thanks for the lessons...it's been an eye-opener.  I'll pro'lly never learn to write code but...see below:
Stig...I "tinkered" a bit...took all reference to "DIM" from your code and got the default to <>.  Now the user can get just 01..02..03 or, by placing a prefix, get DIM01..DIM02..DIM03....ONE SWEEEET ROUTINE, SIR. ONE SWEEEET ROUTINE!
(I know where to look for some of this stuff....) :roll:

daron

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #49 on: October 02, 2003, 04:58:04 PM »
Below???

SMadsen

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #50 on: October 02, 2003, 05:49:15 PM »
Dang t-bear, you destroyed the "Bell Default Method" that I managed to sneak into that routine (anyone noticed that?)  :)

Seriously though, - good work changing it to suit your need.

daron

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #51 on: October 02, 2003, 05:57:57 PM »
Okay, now I feel like the guy that was invited but sent as a joke to the wrong party. Where's the code you see, Stig? And, no, I didn't notice the BDM. Where is it?

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
AutoLISP routine help!!!! (by collegeCAD)
« Reply #52 on: October 02, 2003, 05:58:31 PM »
Quote from: SMadsen
Dang t-bear, you destroyed the "Bell Default Method" that I managed to sneak into that routine (anyone noticed that?)  :)

Seriously though, - good work changing it to suit your need.


Hey i never did get a chance to wrap my head arround that. I should go do that.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

SMadsen

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #53 on: October 02, 2003, 06:09:43 PM »
Daron, you don't see the code t-bear posted? Did you try whack your monitor?
I did, and I still can't see it.

The BDM is in the (setq laypref .. ) call. It's not as clean as it should be because there are some SETQ's in it (and one variable being tossed around, eww) but it's there.

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
AutoLISP routine help!!!! (by collegeCAD)
« Reply #54 on: October 02, 2003, 06:17:05 PM »
Quote
Originally posted by R. Robert Bell
Has it ever bugged you trying to handle a default option with (getkword)?

The usual method I've seen is to get the input, and then handle the user's selection of the default, resetting the variable if need be. Here is an example of the "traditional" method (not really PHP, but I need those stupid brackets):

Code: [Select]
(initget 0 "Length Width Depth Time")
(setq Inp (getkword "\nSpecify a dimension [Length/Width/Depth/Time] <Time>: "))
(setq Inp (if Inp Inp "Time"))



Consider the alternative below however.

Code: [Select]
(initget 0 "Length Width Depth Time")
(setq Inp (cond ((getkword "\nSpecify a dimension [Length/Width/Depth/Time] <Time>: "))
                ("Time")))


By using (cond) to evaluate the return from (getkword), if it is nil (which happens if the user hits enter for the default), we can use the 2nd condition to return the default value. Otherwise, (getkword) will return something, so the first condition sets the value for the variable.

The clever programmer can even develop a slick function for general input. Why? Notice the repetitive elements in the example.

If there is enough interest, I will post mine. [/b]


Oh thats cool. Alright im off to look for a better way yet. :wink:
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

daron

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #55 on: October 02, 2003, 06:20:33 PM »
No Stig, I don't and I will not whack my computer. :(

SMadsen

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #56 on: October 02, 2003, 06:23:45 PM »
Heh, good luck Se7en. I'll bet a sixpack (of danish beer) that you can't make it shorter .. edited: oops, or BETTER .. (with all the functionality - don't forget the bracketed choices) unless you write an Assembler interface for AutoLISP :)

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
AutoLISP routine help!!!! (by collegeCAD)
« Reply #57 on: October 02, 2003, 06:49:56 PM »
yeah, that is a perty good way. I havent thought of a way yet. Im betting that, 'that' is the best way.

what dont you have one of those yet Stig?!
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

t-bear

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #58 on: October 02, 2003, 06:50:38 PM »
Stig....
I didn't mean to rain on your parade.  I SAW it...just didn't realize how special it was.  To find that these guys missed it makes me feel all fuzzy inside ('course I was huntin' for sumpin suspific....)
Even a blind hog finds an acorn sometimes.
Now....did I do something wrong in the routine?  I deleted the word "DIM" in all its instances but left the parens () and quotes "" in place.  Are they still needed or can I get the same result a "cleaner" way?
Guess I'm asking some purty basic stuff here....hope you're not gittin' bored.....

daron

  • Guest
AutoLISP routine help!!!! (by collegeCAD)
« Reply #59 on: October 02, 2003, 06:58:38 PM »
Bear, will you show me where you posted this? I'd really like to see it.