Jump to content

Recommended Posts

Posted
when you have come up with all your solutions can somebody upload a "watermarked" file. It would be fun seeing how secure it is.

 

Haha, would be a good challenge.. although anyone with a bit of reactor knowledge would immediately know how to disable it :(

  • Replies 61
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    22

  • the-trooper

    16

  • alanjt

    11

  • ReMark

    5

Top Posters In This Topic

Posted Images

Posted

Getting closer - this will make a Persistent Reactor, and also fix a few bugs:

 

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:water [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] per[b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b]

 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] *lay [b][color=RED]([/color][/b][b][color=BLUE]vla-get-Layers[/color][/b]
              [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b]
                [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-acad-object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] per [b][color=BLUE]t[/color][/b][b][color=RED])[/color][/b] [i][color=#990099];; Make Reactor Persistent[/color][/i]

 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]not[/color][/b] *wMark*[b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]progn[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] *wMark*
       [b][color=RED]([/color][/b][b][color=BLUE]vlr-command-reactor[/color][/b] [b][color=#ff00ff]"wMarkr"[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]list[/color][/b]
           [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] [color=Blue][b]:vlr-commandWillStart[/b][/color] [b][color=DARKRED]'[/color][/b]Lock[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] per [b][color=RED]([/color][/b][b][color=BLUE]vlr-pers[/color][/b] *wMark*[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]not[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]tblsearch[/color][/b] [b][color=#ff00ff]"LAYER"[/color][/b] [b][color=#ff00ff]"WMark"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]vla-put-plottable[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-add[/color][/b] *lay [b][color=#ff00ff]"WMark"[/color][/b][b][color=RED])[/color][/b] [b][color=Blue]:vlax-false[/color][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n** Reactor Initiated **"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n** Reactor Already Running **"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] Lock [b][color=RED]([/color][/b]Reac Args[b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]or[/color][/b] *lay [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] *lay
            [b][color=RED]([/color][/b][b][color=BLUE]vla-get-layers[/color][/b]
              [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b]
                [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-acad-object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]not[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]wcmatch[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strcase[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] Args[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=#ff00ff]"*ZOOM*,*PAN*"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]vla-put-Lock[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-item[/color][/b] *lay [b][color=#ff00ff]"WMark"[/color][/b][b][color=RED])[/color][/b] [b][color=Blue]:vlax-true[/color][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:drain [b][color=RED]([/color][/b] [b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]or[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] *wMark* [b][color=RED]([/color][/b][b][color=BLUE]vlr-added-p[/color][/b] *wMark*[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlr-pers-list[/color][/b][b][color=RED])[/color][/b]
              [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] *wMark*
                [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-remove-if-not[/color][/b]
                       [b][color=RED]([/color][/b][b][color=BLUE]function[/color][/b]
                         [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b]x[b][color=RED])[/color][/b]
                           [b][color=RED]([/color][/b][b][color=BLUE]eq[/color][/b] [b][color=#ff00ff]"wMarkr"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlr-data[/color][/b] x[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
                       [b][color=RED]([/color][/b][b][color=BLUE]vlr-pers-list[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]progn[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlr-pers-p[/color][/b] *wMark*[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlr-pers-release[/color][/b] *wMark*[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vlr-remove[/color][/b] *wMark*[b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] *wMark* [b][color=BLUE]nil[/color][/b] *lay [b][color=BLUE]nil[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n** Reactor Deactivated **"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n** Reactor Not Running **"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

 

But we still have the problem of making the Subs load when they open the drawing... I don't think you can get around this... :(

Posted
The problem will be that the callback data associated with the reactor (if made persistent) will need to be loaded upon opening the drawing for the reactor to successfully function.

 

Not quite sure how you are going to get around that one... o:)

 

I have no idea what you're talking about since i have no idea what reactor is. If not nuclear :D

 

But i tested it and it (seems?) to work. I write text, "water" it, and it is locked.

Copy/paste that block to new drawing and text remains protected.

Copy base it to new drawing and it remains protected.

Exit AutoCAD, repete procedure - protected.

 

Sure, i figured out how to get rid of it in about 28 seconds, but that's not the point :D

Posted
I have no idea what you're talking about since i have no idea what reactor is. If not nuclear :D

 

But i tested it and it (seems?) to work. I write text, "water" it, and it is locked.

Copy/paste that block to new drawing and text remains protected.

Copy base it to new drawing and it remains protected.

Exit AutoCAD, repete procedure - protected.

 

Sure, i figured out how to get rid of it in about 28 seconds, but that's not the point :D

 

How can you copy the objects on the locked layer? :huh:

Posted
How can you copy the objects on the locked layer? :huh:

 

You wrote it, you tell me :D

 

I just copy the entire block and trademark goes with it.

Posted
You wrote it, you tell me :D

 

I just copy the entire block and trademark goes with it.

 

Thats weird - I wouldn't have thought you could copy objects on the locked layer. :huh:

 

And how the reactor stays in tact when you re-open the drawing (if you aren't loading the subs) bewilders me also...

Posted

I tried it and now it is self-replicating in all my drawing folders. You have created a monster!

 

 

 

 

 

 

 

Kidding!!!!!!!!!!!!!!!!!!!!

 

Nice job Lee. You really do thrive on a challenge.

 

No, it does not carry through to other drawings.

Posted

Thanks ReMark,

 

But seriously, does it carry through to other drawings?

Posted
Thats weird - I wouldn't have thought you could copy objects on the locked layer. :huh:

 

And how the reactor stays in tact when you re-open the drawing (if you aren't loading the subs) bewilders me also...

 

But seriously, does it carry through to other drawings?

 

Yes. Here it is (with the latest version), test it yourself. Created, in 2007, saved as 2004. Works just like it should.

Water - test.dwg

Posted
Yes. Here it is (with the latest version), test it yourself. Created, in 2007, saved as 2004. Works just like it should.

 

Nope it doesn't...

 

Command: _.erase ; error: no function definition: LOCK

1 found

 

Just as I suspected :)

Posted

WARNING, it does not!!! After drawing is SAVED, layer can be unlocked and that's the end of story :cry:

Posted
WARNING, it does not!!! After drawing is SAVED, layer can be unlocked and that's the end of story :cry:

 

I don't think you quite understand how the reactor works - it needs the callback function (the part that locks the layer) to be loaded when the drawing is opened. So, because I didn't load it, the reactor didn't take effect.

Posted
Thanks, but it was Alan's idea... o:)

 

now that's what i'm talking about, i come up with the idea, someone else executes it and i get a partial credit. :)

seriously though, very nice work Lee.

 

 

i don't understand why one can't just place the objects on a locked layer (even put a "IF YOU ALTER YOU ARE FIRED" prefix/suffix on the layer name, if you felt so inclined) and inform users that this layer is NOT to be messed with. i too, have dealt with some real cad boobs, but it's always better to educate and inform, than to assume the worst and put a giant 3-headed dog on a pad locked door.

 

just my feelings on the situation.

 

btw, i just have to know, who noticed the Harry Potter reference (not the best one, since it was in the movie also)?

Posted
btw, i just have to know, who noticed the Harry Potter reference (not the best one, since it was in the movie also)?

 

I assumed you're talking about Cerberus, three headed dog that guards the gates of Hades in Greek myths.

Posted
I assumed you're talking about Cerberus, three headed dog that guards the gates of Hades in Greek myths.

 

while i agree, that would have been better. the first thing that popped into my mind, when i typed it, was Harry Potter.

 

I guess my HP knowledge takes priority over my Greek mythology.

Posted
while i agree, that would have been better. the first thing that popped into my mind, when i typed it, was Harry Potter.

 

I guess my HP knowledge takes priority over my Greek mythology.

 

What has the world come to... o:)

Posted
What has the world come to... o:)

i'm just a stupid American (notice the excessive use of contractions).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...