Lee Mac Posted August 27, 2009 Share Posted August 27, 2009 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 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 27, 2009 Share Posted August 27, 2009 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... Quote Link to comment Share on other sites More sharing options...
the-trooper Posted August 27, 2009 Author Share Posted August 27, 2009 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... I have no idea what you're talking about since i have no idea what reactor is. If not nuclear 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 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 27, 2009 Share Posted August 27, 2009 I have no idea what you're talking about since i have no idea what reactor is. If not nuclear 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 How can you copy the objects on the locked layer? Quote Link to comment Share on other sites More sharing options...
the-trooper Posted August 27, 2009 Author Share Posted August 27, 2009 How can you copy the objects on the locked layer? You wrote it, you tell me I just copy the entire block and trademark goes with it. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 27, 2009 Share Posted August 27, 2009 You wrote it, you tell me 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. And how the reactor stays in tact when you re-open the drawing (if you aren't loading the subs) bewilders me also... Quote Link to comment Share on other sites More sharing options...
ReMark Posted August 27, 2009 Share Posted August 27, 2009 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 27, 2009 Share Posted August 27, 2009 Thanks ReMark, But seriously, does it carry through to other drawings? Quote Link to comment Share on other sites More sharing options...
the-trooper Posted August 27, 2009 Author Share Posted August 27, 2009 Thats weird - I wouldn't have thought you could copy objects on the locked layer. 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 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 27, 2009 Share Posted August 27, 2009 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 Quote Link to comment Share on other sites More sharing options...
the-trooper Posted August 27, 2009 Author Share Posted August 27, 2009 WARNING, it does not!!! After drawing is SAVED, layer can be unlocked and that's the end of story Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 27, 2009 Share Posted August 27, 2009 WARNING, it does not!!! After drawing is SAVED, layer can be unlocked and that's the end of story 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. Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 27, 2009 Share Posted August 27, 2009 Thanks, but it was Alan's idea... 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)? Quote Link to comment Share on other sites More sharing options...
the-trooper Posted August 27, 2009 Author Share Posted August 27, 2009 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. Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 27, 2009 Share Posted August 27, 2009 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 27, 2009 Share Posted August 27, 2009 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... Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 27, 2009 Share Posted August 27, 2009 What has the world come to... i'm just a stupid American (notice the excessive use of contractions). Quote Link to comment Share on other sites More sharing options...
dbroada Posted August 27, 2009 Share Posted August 27, 2009 What has the world come to... so if I was to say Homer, who do you think of? http://en.wikipedia.org/wiki/Homer or http://en.wikipedia.org/wiki/Homer_simpson Quote Link to comment Share on other sites More sharing options...
Glen Smith Posted August 27, 2009 Share Posted August 27, 2009 How 'bout : http://advertisingiconmuseum.org/inside/c4/3248024.html Clearly I spend too much time doing projects and not enough time reading highbrow lit'rature or watching lowbrow tel'vision. Glen Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 27, 2009 Share Posted August 27, 2009 so if I was to say Homer, who do you think of? http://en.wikipedia.org/wiki/Homer or http://en.wikipedia.org/wiki/Homer_simpson i think a lot of it has to do with pop culture. yes, i would think of homer simpson immediately, but i would also think about Homer, the greek who wrote The Odyssey and The Iliad (both good reads, btw). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.