Author Topic: Auto Layering  (Read 15742 times)

0 Members and 1 Guest are viewing this topic.

Guest

  • Guest
Re: Auto Layering
« Reply #15 on: August 24, 2006, 12:22:23 PM »
Quote
I do not take kindly to password cracking, hacking etc.

Um, when your password is [REDACTED]1....

Believe me, I wasn't trying to "hack" the program.  I simply wanted to see if there was any malicious code behind the scenes.
When the input box came up I thought, "What the hell."  Quite surprised when it actually worked.


As a side note, one thing I would add to the program is a call to reset the layer if ESC is pressed.  I rarely, if ever, follow through with the dimension command, meaning, I don't type EXIT to end the command.  It would be a nice feature!



Edit - by Nivuahc:
1 - Seriously, don't do that again.
« Last Edit: August 24, 2006, 12:32:09 PM by nivuahc »

Maverick®

  • Seagull
  • Posts: 14778
Re: Auto Layering
« Reply #16 on: August 24, 2006, 12:24:03 PM »
   Seriously though man.  On a site full of peeps who program..... not cool.  I know, I know.  Actually not cool anyway but... If it was protected for some reason then the person who created it wanted it that way and has the right to do so. 

  Now go sit in the truck and don't touch any of the buttons.  :wink:

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Auto Layering
« Reply #17 on: August 24, 2006, 12:28:30 PM »
Matt, you seem to have missed the entire point. As I stated before, if you wanted the source, all you needed to do was simply ask. It is not about what the password is/was or should be, or even that there was or was not a password on it in the first place. It is merely that you would:

a) attempt to circumvent any password protection, regardless of the strength of the password
b) publicly announce that you hacked the password
c) display the password in a forum where hacking etc. is regarded as a serious violation
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

Guest

  • Guest
Re: Auto Layering
« Reply #18 on: August 24, 2006, 12:46:23 PM »
Okay okay... I admit I messed up.  I promise never to do that again.

Please accept this nugget of code as a token of my good will.
I use it to automatically put xrefs on a locked layer so they can't be accidentally moved, erased, rotated, etc...

I have it in my ACAD.DVB file so it's always there ready to go.

Part of it came from Tony T a while back.

Code: [Select]
Public blnLayerChange As Boolean
Public Tpent As Long


Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
    On Error GoTo ReactorError
    blnLayerChange = False

    Select Case UCase$(CommandName)
        Case "XATTACH"
            Tpent = ThisDrawing.ActiveLayout.Block.Count
        Case "XREF"
            Tpent = ThisDrawing.ActiveLayout.Block.Count
    End Select
    Exit Sub

ReactorError:
    Resume Next
End Sub

Private Sub AcadDocument_EndCommand(ByVal CommandName As String)
    Dim Taent As Long
    Dim i As Integer
    Dim MyEnt As AcadBlockReference
    On Error GoTo ReactorError
   
    Select Case UCase(CommandName)
        Case "XATTACH"
            If UCase(CommandName) = "XATTACH" Then
                CreateLayer "BVHG-Xref", True, False, True, "7", "Continuous"
                Taent = ThisDrawing.ActiveLayout.Block.Count
                If Taent > Tpent Then
                    For i = Tpent To Taent - 1
                        Set MyEnt = ThisDrawing.ActiveLayout.Block(i)
                        MyEnt.Layer = "bvhg-xref"
                    Next i
                End If
            End If
        Case "XREF"
            If UCase(CommandName) = "XREF" Then
                CreateLayer "BVHG-Xref", True, False, True, "7", "Continuous"
                Taent = ThisDrawing.ActiveLayout.Block.Count
                If Taent > Tpent Then
                    For i = Tpent To Taent - 1
                        Set MyEnt = ThisDrawing.ActiveLayout.Block(i)
                        MyEnt.Layer = "bvhg-xref"
                    Next i
                End If
            End If
    End Select

    Exit Sub
   
ReactorError:
    Resume Next
End Sub

Function CreateLayer(ByVal LayerName As String, ByVal LayerOn As Boolean, _
                     ByVal LayerFreeze As Boolean, ByVal LayerLock As Boolean, _
                     ByVal LayerColor As String, ByVal LayerLType As String)
    Dim NewLayer As AcadLayer
    Dim color As AcadAcCmColor
   
    Set NewLayer = ThisDrawing.Layers.Add(LayerName)
   
    Set color = New AcadAcCmColor
    With color
        .ColorMethod = acColorMethodByACI
        .ColorIndex = LayerColor
    End With
    NewLayer.LayerOn = LayerOn
    NewLayer.Freeze = LayerFreeze
    NewLayer.Lock = LayerLock
    NewLayer.color = LayerColor
    NewLayer.Linetype = LayerLType
End Function

Again, I'm sorry.  Can you forgive me?

spawnd

  • Guest
Re: Auto Layering
« Reply #19 on: August 24, 2006, 02:16:44 PM »
Wow...completely different direction then I thought it it go in...

To re-word the question...In the marco area for a linear dimension (^C^C_dimlinear) you can add to macro by typing after the main text.  I would like to add the -la command with all the layer standards I want for that object.

spawnd

  • Guest
Re: Auto Layering
« Reply #20 on: August 24, 2006, 03:01:32 PM »
alright...I fingured it out (yes I misspelled that way)

if you put the text "^C^C_-la m A-Anno-Dims c 2  lw .35  ps medium  ^C^C_dimlinear" into the macro line in the cui file, it will always come in on the spicified layer.

Thanks to everyone who tried to help and Maverick nice icon.
« Last Edit: August 24, 2006, 03:15:25 PM by spawnd »

Murphy

  • Guest
Re: Auto Layering
« Reply #21 on: August 24, 2006, 03:37:58 PM »
Psst... [whisper] That's not his icon, that's the feed from his web cam [/whisper]

Maverick®

  • Seagull
  • Posts: 14778
Re: Auto Layering
« Reply #22 on: August 24, 2006, 04:38:30 PM »
Yup.  If you keep watching it (me) you will see it (me) move. 


(This reminds me of a tshirt I have.. On the front it asks "Wanna know how to keep an idiot busy?  See back"   :-D)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Auto Layering
« Reply #23 on: August 25, 2006, 10:51:24 AM »
Okay okay... I admit I messed up.  I promise never to do that again.

Sorry, I have been under alot of load here at work and had to devote at least a little time to my job. ;)

No harm no foul .. I mostly brought it up as a word of advice about how TheSwamp operates and what is considered acceptable behavior in our midst.
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

deegeecees

  • Guest
Re: Auto Layering
« Reply #24 on: August 25, 2006, 11:22:43 AM »
Yup.  If you keep watching it (me) you will see it (me) move. 


(This reminds me of a tshirt I have.. On the front it asks "Wanna know how to keep an idiot busy?  See back"   :-D)

Ok, so what'd it say on the back? Hmmm?

Maverick®

  • Seagull
  • Posts: 14778
Re: Auto Layering
« Reply #25 on: August 25, 2006, 11:29:32 AM »
Ok, so what'd it say on the back? Hmmm?

Do you really want to know or are you making a funny?  *taking out scorecard*   :-D

deegeecees

  • Guest
Re: Auto Layering
« Reply #26 on: August 25, 2006, 11:35:58 AM »
My interest is truly peaked.

Maverick®

  • Seagull
  • Posts: 14778
Re: Auto Layering
« Reply #27 on: August 25, 2006, 12:06:40 PM »
"Wanna know how to keep an idiot busy?  See front"

Greg B

  • Seagull
  • Posts: 12417
  • Tell me a Joke!
Re: Auto Layering
« Reply #28 on: August 25, 2006, 12:20:56 PM »
I don't get it.

nivuahc

  • Guest
Re: Auto Layering
« Reply #29 on: August 25, 2006, 12:39:31 PM »
I don't get it.

And with a face like that, you never will ;)