Author Topic: Reversing Bylayer Lisp...  (Read 8405 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Reversing Bylayer Lisp...
« on: March 16, 2005, 12:17:04 PM »
Does anyone have a lisp which will reverse bylayer to the exact linetype and color and reset the layer to 0? or something like this?

Thanks!
Civil3D 2020

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Reversing Bylayer Lisp...
« Reply #1 on: March 16, 2005, 12:29:18 PM »
I'm sorry I don't follow. Perhaps a little more explaining is needed. :D
TheSwamp.org  (serving the CAD community since 2003)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Reversing Bylayer Lisp...
« Reply #2 on: March 16, 2005, 12:34:00 PM »
I think it's as follows -

Say entity is on layer "MSTG007".

Entity's color and ltype are currently set to bylayer.

Said layer is set to color 42, linetype DOT2X.

I believe he wants the entity to be hard coded to color 42, ltype DOT2X.

Incidentally I think this is evil.

/opinion
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CADaver

  • Guest
Reversing Bylayer Lisp...
« Reply #3 on: March 16, 2005, 12:43:32 PM »
Quote from: MP
Incidentally I think this is evil.
/opinion
Makes Se8en look saintly.

cadbrowser

  • Guest
Reversing Bylayer Lisp...
« Reply #4 on: March 16, 2005, 01:58:03 PM »
Quote from: MP


Incidentally I think this is evil.





I must agree with you MP, I too believe it is evil...so evil it must be eeeeeeeeeeeeeeeeviiiiiiiiilllll.

With that said, YES there is a way to do it.  
CLICK HERE!

Let me know how you like it.


SMadsen

  • Guest
Reversing Bylayer Lisp...
« Reply #5 on: March 16, 2005, 02:03:23 PM »
Evil? Can't it be part of exchanging drawings with clients/partners on other systems?

.. nah

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Reversing Bylayer Lisp...
« Reply #6 on: March 16, 2005, 02:16:15 PM »
From my experience I have to say it's pure evil. I've written utilities like this before on request for the very reason you noted Stig, but when I did it I saved the original properties so they could be restored at a later date if needed; kind of a round trip kinda thing.

But to repeat, from my point of view it's generally PURE EVIL to supply code to do this. There's a lot of CADD Operators who don't like following CADD Standards, find using layers "a pain". These folks will use a utility like this (without approval) undetected for months, creating buckets of unneccesary work for the CADD Janitors, who have to fix the drawings before they're turned over to the client.

Points of view vary, this is mine.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CADaver

  • Guest
Reversing Bylayer Lisp...
« Reply #7 on: March 16, 2005, 02:20:57 PM »
Quote from: SMadsen
partners on other systems?  
That too, is evil. :)

dubb

  • Swamp Rat
  • Posts: 1105
Reversing Bylayer Lisp...
« Reply #8 on: March 16, 2005, 02:27:12 PM »
i dont really like drawings that has one layer called "0" because it makes it difficult to differentiate between parts of the drawing. its just not common practice for me. but there's is one solution to that....and it is to not touch the drawing. id rather xref it and trace what i need with new layers and make that xref on a light background layer. that way i dont mess with someonelses work. but i do want to mention that this whole reversing layers to make them all to zero is nuts, i cant beleive people still do this

SMadsen

  • Guest
Reversing Bylayer Lisp...
« Reply #9 on: March 16, 2005, 02:39:09 PM »
Quote from: CADaver
Quote from: SMadsen
partners on other systems?  
That too, is evil. :)

LOL

cadbrowser

  • Guest
Reversing Bylayer Lisp...
« Reply #10 on: March 16, 2005, 03:34:37 PM »


Should I then retract my EVIL program?

I agree on the evil nature, and I can't believe that people would mimic the "BENTLEY PROTOCAL"...as I would name it.  Even masters of the bentley system draw everything on one layer (usually 0) and color every object differently.  OR they use multiple layers and STILL color each object differently than the layer property holds.  

Importing this type of mess into an AutoCAD drawing makes for a monitor throwing, CPU vs your hammer, and keyboard banging a regular practice.

Quote from: MP

But to repeat, from my point of view it's generally PURE EVIL to supply code to do this.


OK, OK, I get the hint...  I will delete the zip file off of my domain...LOL


MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Reversing Bylayer Lisp...
« Reply #11 on: March 16, 2005, 03:39:17 PM »
I'm just expressing my point of view Oz.

It's totally your call, in other words, don't feel I was pressuring you to remove it, I wasn't.

Peace.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Reversing Bylayer Lisp...
« Reply #12 on: March 16, 2005, 03:40:58 PM »
Quote from: MP
From my experience I have to say it's pure evil.

 These folks will use a utility like this (without approval) undetected for months, creating buckets of unneccesary work for the CADD Janitors, who have to fix the drawings before they're turned over to the client.


I have a routine that is part of Autocad-Close event that resets entire dwg to bylayer everything.  When my users ignore layers, they get to do the work again
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

cadbrowser

  • Guest
Reversing Bylayer Lisp...
« Reply #13 on: March 16, 2005, 03:51:06 PM »
Quote from: MP
I'm just expressing my point of view Oz.

It's totally your call, in other words, don't feel I was pressuring you to remove it, I wasn't.

Peace.

:)




Oz?!?  No that is who I quote.  I can't place myself in a near parsec with the great and powerful Oz!  You can call me CB if'n ya want to.

I didn't feel pressured MP.  I agree with you that it is pure evil to provide code that'll make headaches for everyone.  Actually, I just wanted to see if I could do it.  Took me all but 10 min...so I guess that would mean I just impressed myself...LOL

I was being highly sarcastic.  I am bored, stuck at work, with nothing to do.  So I thought I'd try my hand at humor.  Sorry if I offended!

Quote from: Cmdrduh

I have a routine that is part of Autocad-Close event that resets entire dwg to bylayer everything. When my users ignore layers, they get to do the work again




Hey NOW...I like that idea.  Did you do that with VB for AutoCAD?


JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Reversing Bylayer Lisp...
« Reply #14 on: March 16, 2005, 03:54:42 PM »
Quote from: CADaver
Makes Se8en look saintly.

*click*Bite your tongue!
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Reversing Bylayer Lisp...
« Reply #15 on: March 16, 2005, 03:55:09 PM »
yes, you want a copy?  I did it in LISP originally, but rewrote it when I was trying to learn VBA
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Reversing Bylayer Lisp...
« Reply #16 on: March 16, 2005, 03:56:14 PM »
Here it is
Code: [Select]
Private Sub AcadDocument_BeginClose()
Dim objSelected As Object
Dim objSelSet As AcadSelectionSet
Dim N As Integer

On Error Resume Next

If ThisDrawing.SelectionSets.Count > 0 Then
    For N = 0 To ThisDrawing.SelectionSets.Count - 1
        If ThisDrawing.SelectionSets.Item(N).Name = "EBL" Then
        ThisDrawing.SelectionSets("EBL").Delete
        End If
    Next N
End If

Set objSelSet = ThisDrawing.SelectionSets.Add("EBL")
objSelSet.Select acSelectionSetAll

For Each objSelected In objSelSet
objSelected.color = acByLayer
objSelected.Linetype = "ByLayer"
objSelected.Lineweight = acLnWtByLayer
objSelected.Update
Next

ThisDrawing.SelectionSets.Item("EBL").Delete
ZoomExtents
ThisDrawing.Application.Update
Exit_Here:
Exit Sub
End Sub
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

t-bear

  • Guest
Reversing Bylayer Lisp...
« Reply #17 on: March 16, 2005, 04:03:47 PM »
Whatever our thoughts on the issue, I believe that MSTG007 feels the need for this.  His reasons are his own.  Because WE think it's against "standards", doesn't mean that he's not forced to do this due to HIS companies "standards"...... Two choices here ... if you feel that something like this should not be propigated on the forum but you want to help MSTG007,  you can send him the code via PM, e-mail, or put it in the lily for a week, then delete it.  Sound reasonable?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Reversing Bylayer Lisp...
« Reply #18 on: March 16, 2005, 04:03:57 PM »
I hear ya on the "See if I could do it" front, a man after me own heart.

Sorry 'bout the Ozzy confusion. LOL man, that guy doesn't have but 3 brain cells holding hands on a good day. :shock:

Crazy idea #1 ==> I invite you to share your real name, makes it friendlier when we all correspond. :)

Crazy idea#2 ==> Go here and tell us your story. :) x 2.

(Michael).
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Reversing Bylayer Lisp...
« Reply #19 on: March 16, 2005, 04:10:02 PM »
Quote from: t-bear
MSTG007 feels the need for this.  His reasons are his own.


I wanted a copy to put away for that REALLY RARE instance when it might come up.  I thought about writing it, but didn't have the time.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

dubb

  • Swamp Rat
  • Posts: 1105
Reversing Bylayer Lisp...
« Reply #20 on: March 16, 2005, 04:13:36 PM »
Quote from: t-bear
Whatever our thoughts on the issue, I believe that MSTG007 feels the need for this.  His reasons are his own.  Because WE think it's against "standards", doesn't mean that he's not forced to do this due to HIS companies "standards"...... Two choices here ... if you feel that something like this should not be propigated on the forum but you want to help MSTG007,  you can send him the code via PM, e-mail, or put it in the lily for a week, then delete it.  Sound reasonable?


well.....i didnt mean to not post this type of content (if you read my other post) it was one of the things i totally petpeeved...but somebody can make use of this type of bylayer thing...i would like to hear...i struggled with it...its nice to know how people handel these types of things....maybe next time i could make a better way to work in these types of situations.

t-bear

  • Guest
Reversing Bylayer Lisp...
« Reply #21 on: March 16, 2005, 04:33:34 PM »
Dubb...you beat me to the punch LOL.  I was in the middle of writing this waaaay back on page 1 and some a** of an engineer came in and actually wanted me to work!! Imagine the gall!  Anyhow, by the time I got back here and finished my thoughts, the post was redundant and outdated.  Apologies to all.....

dubb

  • Swamp Rat
  • Posts: 1105
Reversing Bylayer Lisp...
« Reply #22 on: March 16, 2005, 04:40:19 PM »
hahaa....its really slow today here at wynn engineering....and its my review today...wish me luck

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Reversing Bylayer Lisp...
« Reply #23 on: March 16, 2005, 08:51:25 PM »
good luck... sorry its been so long...
Reason is like t-bear said... co. standards...

they get alot of other people surveys and dwgs... they want it all to be on one layer... lord knows why. I can only tell them the truth the way and the light of cad standards...

They are more in a position of speed than of breaking out layers onto other layers... etc.
Civil3D 2020

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Reversing Bylayer Lisp...
« Reply #24 on: March 16, 2005, 08:51:56 PM »
lol is this a LSP file or VB?
Civil3D 2020

daron

  • Guest
Reversing Bylayer Lisp...
« Reply #25 on: March 17, 2005, 07:31:53 AM »
If you're referring to this post, it's vba.

cadbrowser

  • Guest
Reversing Bylayer Lisp...
« Reply #26 on: March 17, 2005, 01:45:20 PM »
Quote from: MP
I hear ya on the "See if I could do it" front, a man after me own heart.

Sorry 'bout the Ozzy confusion. LOL man, that guy doesn't have but 3 brain cells holding hands on a good day. :shock:

Crazy idea #1 ==> I invite you to share your real name, makes it friendlier when we all correspond. :)

Crazy idea#2 ==> Go here and tell us your story. :) x 2.

(Michael).




No problem MP, you are right about his brain cells...but think about this...I know people that has 3 billion brain cells and don't even come close to the musical genius of the Oz man.  Just think, if he can do all that with bearly 3 brain cells holding hands...well, he's better off than I... :)

My given name is Jeremiah, but I've been called worse (some I can't say in here :shock: )

As far as my "story", when I get more time I'll do that as well.


Quote from: MSTG007

lol is this a LSP file or VB?


If you want the lisp version, just email me and I'll send it to you.

jeremiah.daniels@kcpl.com  is the best one to use right now.
[/color]

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Reversing Bylayer Lisp...
« Reply #27 on: March 17, 2005, 01:55:55 PM »
Genius? Ummm, call me paranoid, and it's just a shot in the dark but me thinks mr. crowley's been barkin' at the moon from a crazy train.

:twisted:

Welcome aboard Jeremiah, enjoy the digs, pull up a chair when ya can share a tale from your diary of a madman. 'Til then see you on the other side.

PS: Fairies wear boots.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst