Ok .. lets look at this from a fresh perspective. I have not followed this thread too close, but it appears as though there is a "bash joe" party going on. This certainly does not follow in the spirit of the swamp that some have touted as being the appropriate behavior.
Upon examination of Joe's comments, (there were several), the basic facts which are ...
- Joe fails to see what is interesting in this particular piece of code
- The code is bloated
- Expresstools has a very similar function
- Code from places OTHER THAN TheSwamp and/or the Autodesk forum is GENERALLY trash
- Just because a function does what it says it should do does not mean it SHOULD be used or that it is worth using
- "Pete's Magic Block Replacer" seems a bit like the author may have been a cad manager or someone more interested in protecting one's job than writing good code
- Joe stands by his comments regardless of whether "Pete" sees it or not.
Now to offer a bit of commentary on these basic "facts" as they have been presented ...
#1 - This is a simple commentary on his personal thoughts about this code ... I have seen similar comments from just about every seasoned programmer that frequents this forum. To speak out in this particular instance is hypocritical for anyone who has ever made such similar statements. I will refrain from name calling as it solves nothing ... you know who you are.
#2 - This statement is 100% accurate and to suggest otherwise helps no one ... however to suggest that a piece of code is bloated will allow those who are learning to code, that there are much more efficient methods that may be used to accomplish a task. This could be correctly used as a fine example of how code may become bloated , particularly when the programmer is inexperienced.
#3 - This is absolutely true ... and yes I do realize that many people may not have Expresstools or may elect to not use them for whatever reason. I personally only use 4 or 5 of them although I have the full suite. For the remaining items I have built my own custom tools, much like many of the fine folks who frequent TheSwamp, however, I suspect that most folks who purchase AutoCAD do have the Expresstools, as they have been included in every release of AutoCAD since R2000 (as far as I can tell) up to and including R2004 ... R14 is the only version that used Bonus tools ... and they were abismal ... but that is merely my own opinion .. others may vary.
#4 - This one is a bit shaky as I have seen some fine examples of code on websites other than TheSwamp and/or Autodesk forums ... but the author did temper the statement with the disclaimer "GENERALLY" ... thus he may not consider all code from other sources as trash, but then again this is his particular commentary ... yours may differ, nothing wrong with that .. it is just different that's all ...
#5 - Ok .. here is where it gets nasty ... I want everyone here who uses an alternate O/S or web browser, (i.e. no Windows or Internet Explorer), that takes offense to this comment to sincerely do some soul searching ... imagine this comment ... "Just because Windows/IE does what is says it is supposed to do, does not mean it should be used or that it is worth using" ... Now step back and re-examine your position. I suspect that a whole lot of Swampers use alternative browsers .. i.e. Firefox, Mozilla, Opera ... heck, I even wrote my own browser ... and if Mark goes back in his logs he may even find it there .. I called it "Swamp Browser" ... still use it on occasion too ... more of an exercise than a desire to create a better browser. It was fast and sleek ... and unencumbered by a majority of the security flaws of other browsers ... but just because I have it does not mean that it is desirable to use it .. or that it should be used. Enough about this ... I think I have gotten my point across.
#6 - Ok ... first off, there is nothing magic about it ... although it may seem like it to a layman .. thus I got the same exact feeling as did Joe. The author is someone who feels self-important (as most cad managers would likely feel) you know the kind that are self absorbed ... I know you do as I have seen the comments from you folks ... the ITwit and the stupid CAD manager threads pop up almost weekly, and have for a long time. The mere fact that the writer of the code alludes to the fact that it is somehow magic or states unequivocally that it is "Pete's" says a whole lot about how he wishes to portray himself. To me that screams "YOU CAN'T DO WITHOUT ME .... BUWAHAHAHAHA" thus the end user being unfamiliar with coding would indeed feel that the person is valuable and deserves to have their job protected, regardless of whther the code is bloated or follows any kind of good programming practices. There is nothing inherently wrong with this statement ... it is what it is ... and many of us HAVE portrayed ourselves as "invaluable" to our respective employers ... all for the sake of self importance. If the shoe fits, wear it... but please don't pretend that "Pete", whomever he may be, is not (or at very least was not at the time of the code writing) a person with a percocious attitude. To do so would be completely inaccurate in my humble opinion.
#7 - Finally, while some of you have chosen to take offense to this comment, I personally find it refreshing ... I do not need to guess where he stands ... this piece of code could have just as well been something I produced many years ago before I would have known better (not this particular piece, but you get the picture) and I would prefer that someone be completely open and honest when dealing with me ... Do YOU like to be treated differently by people when they know you are around? i.e. would you prefer that your co-worker be open about the fact that they think you are an idiot or would you prefer that they be nice to you while you are standing there, then talk crap about you when you leave ... this kind of puts a different perspective on it now doesn't it. I don't know anyone who would prefer to be lied to or at very least be patronized by people who have a dislike for them or their work habits. Being honest and open about ones feelings is perhaps the one last thing that we can do ... now of course I am not advocating wholesale bashing, but if it looks like a duck, walks like a duck and quacks like a duck, it just might be a duck ... and I will be hard pressed to call it a turkey.
Ok .. if you have gotten this far in my unbelievably bloated commentary (dangit I can be long winded) you should note that while I would not have made those comments myself, I will stand behind the honesty in which Joe made them. If they had been inflamitory or derogatory I would have been the first to delete it ... but the mere fact that nobody saw fit to delete the post means that it certainly did not fall outside the bounds of the spirit of the swamp, since it would have surely been deleted had it done so. Personally I find the ensuing commentary much ado about nothing and it serves no purpose except to prompt people to take sides ... and as it stands here now, I am ashamed that I feel compelled to engage in perpetuating this discussion.
Where oh where has the time gone when people could engage in honest and open debate without getting their feelings hurt.
And here is a simple code bit that allows for replacement of any selected blocks with the block name of the users choice ... no fancy browse for files, no configurable options ... simply if you select the block you can change it with another block already defined in the drawing.
(PRINC "\n -- Change Block Version 2.3 -- start command with --> CB ")
(princ "\n -- Copyright (C) 1997-2006 by K.E. Blackie ")
(princ "\n")
(DEFUN C:CB()
(setq ss (ssget))
(prompt"\nNew Block Name: ")
(setq new_value (getstring t))
(setq index 0)
(repeat (sslength ss)
(setq e (entget(ssname ss index)))
(setq as (assoc 2 e))
(setq e (subst (cons 2 new_value) as e))
(entmod e)
(setq index (+ 1 index))
)
(princ)
)