TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Mark on September 16, 2005, 01:21:39 PM
-
How to load a routine without having it being part of a acaddoc.lsp, acad.lsp, not inside of the suite, not part of any startup, not even being saved inside of any support folder of autocad.
The routine will be loaded only if exist and still is inside of the original folder location, the user will need to load the routine from there, called or not the routine command and after that, save it, and the next time the drawing session is open it will call the routine to be loaded.
How do you enable that?
-
Not sure if I fully comprehend the question, but it sounds to me like a round about way of referring to mnl files.
/guess
-
Not sure if I fully comprehend the question, but it sounds to me like a round about way of referring to mnl files.
/guess
Not even inside of an MNL
Here are the steps:
1. Load the routine from any where
2. Saved the drawing
3. Open that drawing and the routine is available, without being load from any other means just by itself...
And no reactors too.
HTH
-
Ah, you mean persistant reactors (evil). Thanks for the hints.
-
Well, when somebody DOES answer this one, I may change the way I do things around here.
Edit: I did see that in the Dev. Help files a while back, but never persued it. I have thought of some apps that will make use of something like this. I think I'll persue this now. :ugly:
Re-edit: OK, no persistant reactors, check. :oops:
-
Ah, you mean persistant reactors (evil). Thanks for the hints.
No persistant reactors too...
Just by itself... on every drawing the routine was used.....
-
Well number one is easy just include the entire path in the load statement.
(load "Y:\\Common\\AUTOLISP\\ad.lsp)
Getting it to reload is trickier if you don't add it any of the files you mentioned.
Or is there a secret sysvar we haven't heard about yet. :pissed:
-
Well number one is easy just include the entire path in the load statement.
(load "Y:\\Common\\AUTOLISP\\ad.lsp)
Getting it to reload is trickier if you don't add it any of the files you mentioned.
Or is there a secret sysvar we haven't heard about yet. :pissed:
No.... nothing that has to do with any normal way we all know, it is a secret way... that is why the question.... hehe
-
How about via a script file? :realmad:
-
Well lol, I think you've a dandy of a question 'cause I dunno.
:-D
-
I GOT IT!!! :mrgreen:
How about loading it via a field in a drawing.
-
Hey Luis wait awhile before posting the answer, we've some friends that are probably into rem sleep right now that would likely enjoy anteing up an answer.
-
How about via a script file? :realmad:
That is a normal way.... is something else.... and it is very efective, the only condition is that the drawing would look if the routine was loaded and tried to call it, every time the drawing session is opened... and of course if the routine file exists... if not if will simple show a message, saying something.... hehe
-
Yous hadn't awta upset the Don. Make good wit da ansa or Rocko n da boyz are gonna hafta do reconstructive surgery on ya kneecaps :pissed: :pissed: :pissed: :pissed: :pissed: :pissed: :pissed: :pissed: :pissed:
-
Hey Luis wait awhile before posting the answer, we've some friends that are probably into rem sleep right now that would likely enjoy anteing up an answer.
If you don't want to post it yet that's fine but if I am close please PM me. If I am way off base then don't worry about it.
-
<cough> Hyperlink.
-
Looked at the documentation a little closer and found this http://www.theswamp.org/screens/ronjonp/clue.htm
-
If you don't want to post it yet that's fine but if I am close please PM me. If I am way off base then don't worry about it.
Way off..... sorry
-
Looked at the documentation a little closer and found this http://www.theswamp.org/screens/ronjonp/clue.htm
:lmao:
not
:pissed:
-
<cough> Hyperlink.
Nope....
-
(http://www.theswamp.org/screens/mp/404.png)
-
Ok,
Here is a vlx file to test this, after that I will post the open source.
Please place the vlx in the same folder with your drawing and load it.
1. Call the command TST
2. Save the drawing and open it again
3. What happen?
4. Is the TST command available?
5. Look on the APPLOAD list and see if the SELFLOAD.VLX is there?
-
Does the soution have to do with editing the AutoCAD registry? I thought I read something about that somewhere...Don't know where.
-
Please do the test on a new drawing... or make a backup first.....
-
<cough>
(&VLO-C lisplet-permanent-data-handle "selfload")
-
Argggg ... I'm this close to crackin' this nut.
:evil:
-
Argggg ... I'm this close to crackin' this nut.
:evil:
What do you think Michael, is this worth or not..... ? or is a mickey-mouse....
-
It's fun crackin' it.
VLO-VL objects, lol, who knew.
Weirdness: '(0 . "VLO-VL") yet '(100 . "vlo_VL") ...
:)
-
It is time to post the code?....
-
PLEASE DON'T POST ANY CODE YET LUIS.
:)
-
It is actually a single line of code.... and a use of a visual lisp function with a T on it...
-
I begin using this approach, for my routines with reactors and like the ability to load the callbacks per drawing.
-
If I was to try with VLisp, first I'd look at
vlax-ldata
and
vlax-add-cmd
Nice Problem Luis,
kwb
-
If I was to try with VLisp, first I'd look at
vlax-ldata
Hey.... it is because you are using the VLX..... and saw the message at loading no?.... hehe
-
Haven't tried yet Luis, Still making my first morning coffee .. :)
-
but I know a little about data persistance, so that headed me in that direction ...
-
Very good guess ... sir!
-
Ok, uncle.
I know you use vlax-ldata-put to put the raw data in:
(vlax-ldata-put
"SmartyPants"
"hello$stickto_free_version"
"(&VLO-C lisplet-permanent-data-handle hello"
)
But I couldn't register it to execute on startup (the above assumed a lisp file in the same directory as the file named hello.lsp).
So ... I examined the data and what appeared different was the flag value associated with group 91. In my non functioning data it had a value of 46 instead of 49. I tried brute force entmodding and it wouldn't take, so I tried a hacker's approach: make the data from scratch and mod to suit (ugly coding, forgive me):
(defun FooYoo ( lispPath / foo1 foo2 )
(defun *error* (x) (vl-bt))
(defun foo1 ( dict dictnametoadd )
(cond
(
(cdr
(assoc -1
(dictSearch
dict
dictnametoadd
)
)
)
)
( (DictAdd dict dictnametoadd
(EntmakeX
'( (0 . "DICTIONARY")
(100 . "AcDbDictionary")
)
)
)
)
)
)
(defun foo2 ( dict dictname lispName / ename ename2 data )
(DictAdd dict dictname
(setq ename2
(EntmakeX
(list
'(0 . "DICTIONARY")
'(100 . "AcDbDictionary")
'(280 . 0)
'(281 . 1)
(cons 3
(strcat
lispName
"$stickto_free_version"
)
)
(cons 350
(setq ename
(entmakex
(list
'(0 . "VLO-VL")
'(100 . "vlo_VL")
'(90 . -64512)
'(91 . 49)
'(92 . 0)
(cons 300
(strcat
"(&VLO-C "
"lisplet-permanent-data-handle "
"\""
lispName
"\")"
)
)
)
)
)
)
)
)
)
)
(setq data
(subst
(cons 330 ename2)
(assoc 330
(setq data
(entget ename)
)
)
data
)
)
(entmod
(append
(setq head
(reverse
(member
(assoc 5 data)
(reverse data)
)
)
)
(list
'(102 . "{ACAD_REACTORS")
(cons 330 ename2)
'(102 . "}")
)
(member (assoc 330 data) data)
)
)
(entmod
(subst
'(91 . 49)
(assoc 91
(setq data
(entget ename)
)
)
data
)
)
)
(foo2
(namedObjdict)
"SmartyPants"
(vl-filename-base lispPath)
)
(princ)
)
(FooYoo "hello")
Makes the very same data, and it will persist but damn, the 91 flag value refuses to be modded and it won't run on startup.
The Main dictionary (look for SmartyPants dictionary item) --
-1 <Entity name: 7ef70c60>
0 DICTIONARY
330 <Entity name: 0>
5 C
100 AcDbDictionary
280 0
281 1
3 ACAD_COLOR
350 <Entity name: 7ef70e18>
3 ACAD_GROUP
350 <Entity name: 7ef70c68>
3 ACAD_LAYOUT
350 <Entity name: 7ef70cd0>
3 ACAD_MATERIAL
350 <Entity name: 7ef70e10>
3 ACAD_MLINESTYLE
350 <Entity name: 7ef70cb8>
3 ACAD_PLOTSETTINGS
350 <Entity name: 7ef70cc8>
3 ACAD_PLOTSTYLENAME
350 <Entity name: 7ef70c70>
3 ACAD_TABLESTYLE
350 <Entity name: 7ef70e70>
3 AcDbVariableDictionary
350 <Entity name: 7ef70db0>
3 SmartyPants <= Hello !!!!!!!!!!!!!!!!
350 <Entity name: 7ef70ea0>
The SmartyPants dictionary object:
-1 <Entity name: 7ef70ea0>
0 DICTIONARY
5 8C
102 {ACAD_REACTORS
330 <Entity name: 7ef70c60>
102 }
330 <Entity name: 7ef70c60>
100 AcDbDictionary
280 0
281 1
3 hello$stickto_free_version
350 <Entity name: 7ef70e98>
The VLO-VL object entry (child of the dictionary object above).
-1 <Entity name: 7ef70e98>
0 VLO-VL
5 8B
102 {ACAD_REACTORS
330 <Entity name: 7ef70ea0>
102 }
330 <Entity name: 7ef70ea0>
100 vlo_VL
90 -64512
91 46 <== bastard value, should be 49
92 0
300 (&VLO-C lisplet-permanent-data-handle "hello")
-- but I got this close.
So ... let me out of my misery. Just kidding, I enjoyed the hacking.
;)
-
I could see myself spending the day on this and NOT solving it either..
I'm miserable too ...
:cry:
-
This is cruel .. Is the sun still up in San Diego .. ?
Luis is probably having a couple of beers and laughing to himself ... :-D
-
Let's see...Luis will tell me I'm wrong but before he does I will disagree with him. As he didn't state lisp routine in the question, I will answer as if it were a VBA routine. type VBAMAN, select the routine, click EMBED. It will load the next time the drawring is opened.
-
Ooh I'm gettin so close ...
private name space lisp and --
(vlax-ldata-put
"smartypants"
"hello"
nil
t
)
It's not firing yet but the data is looking better ...
/refuse to give up.
-
Ok. If I use this statement --
(vlax-ldata-put
"MyDictionary"
"MyFunction"
nil
t
)
Compile to a seperate namespace vlx named Hacker.vlx, and subsequently load that into a drawing, we get these entries --
Dictionary in NamedObjDict:
-1 <Entity name: 7ef70c60>
0 DICTIONARY
330 <Entity name: 0>
5 C
100 AcDbDictionary
280 0
281 1
;; deleted crud I don't care about
3 MyDictionary
350 <Entity name: 7ef70e98>
Child Dictionary:
-1 <Entity name: 7ef70e98>
0 DICTIONARY
5 8B
102 {ACAD_REACTORS
330 <Entity name: 7ef70c60>
102 }
330 <Entity name: 7ef70c60>
100 AcDbDictionary
280 0
281 1
3 Hacker$MyFunction
350 <Entity name: 7ef70ed8>
VLO-VL Object
-1 <Entity name: 7ef70ed8>
0 VLO-VL
5 93
102 {ACAD_REACTORS
330 <Entity name: 7ef70e98>
102 }
330 <Entity name: 7ef70e98>
100 vlo_VL
90 -64512
91 52
92 0
300 (&VLO-C lisplet-permanent-data-handle "Hacker")
Saga continues ...
:evil:
-
Ok. I can get it to work, but the function is firing twice, so I have to place some kind of flag so it recognizes it's already been run once.
:evil:
-
Michael,
Very impress of all your effort... all we need to do is to place on top of our lisp file a call like:
(vl-load-com)
(vlax-ldata-put "reactorswiz" "stickto_free_version" nil t)
(alert "this is only a test")
(defun C:TST ()
(alert
"I can be self loaded if you save the drawing\nAnd the next time you open it I will be back"))
Then make a protected separate namespace VLX, have our vlx place in the same folder as our drawing, load the vlx and saved the drawing and that's it....
Have fun!
Luis.
Kerry... Beers will wait for tomorrow, we are going for a wedding in Mexicali and the sun there is really something....
-
And.... I found that by reading "vlr-pers-dictname" and after seeing this: vlr-reactor.getdictkey - some few years ago....
Now, what would be the conclusion?
Good
Bad
Does not matter
-
And.... I found that by reading "vlr-pers-dictname" and after seeing this: vlr-reactor.getdictkey - some few years ago....
Pays to RTFM.
:)
Now, what would be the conclusion?
Good
Bad
Does not matter
None of the above: Very Interesting indeed, thanks for the trip.
:)
-
conclusion :
Really Interesting !!
I could see it being abused, but then, so can almost anything.
Right now I can thing of a couple of neat uses for this.
It would be fairly simple to write a removal tool, yes ??
Hope I can make some time next week to play.
Thanks Luis and Good Effort Michael.
.. back to the grindstone ..
kwb
-
It would be fairly simple to write a removal tool, yes ??
By whom?
-
Let's see...Luis will tell me I'm wrong but before he does I will disagree with him. As he didn't state lisp routine in the question, I will answer as if it were a VBA routine. type VBAMAN, select the routine, click EMBED. It will load the next time the drawring is opened.
:-)
Sorry Bob,
No dark side ... forgot to mention that was just with the lispy stuff.
-
<Festus> Simple entdel on that thar dictionary varmit blows it into smithereens ... </Festus>
-
<Festus> Simple entdel on that thar dictionary varmit blows it into smithereens ... </Festus>
Did you check if this is kaput.... too?
Opening an AutoCAD 2004 format file.
Regenerating model.
Restoring Ldata-> <<<<------ this one after deleting....
-
By whom?
You'd just have to know what to look for ...
(massoc 3 (entget (namedobjdict)))
("ACAD_COLOR" "ACAD_GROUP"
"ACAD_LAYOUT"
"ACAD_MATERIAL"
"ACAD_MLINESTYLE"
"ACAD_PLOTSETTINGS"
"ACAD_PLOTSTYLENAME"
"ACAD_TABLESTYLE"
"AcDbVariableDictionary"
"reactorswiz"
)
.. and know how to blow it up ..
-
<Festus> Simple entdel on that thar dictionary varmit blows it into smithereens ... </Festus>
Did you check if this is kaput.... too?
Opening an AutoCAD 2004 format file.
Regenerating model.
Restoring Ldata-> <<<<------ this one after deleting....
Yep, varmit be gone, just entdel inside out.
-
By whom?
You'd just have to know what to look for ...
(massoc 3 (entget (namedobjdict)))
("ACAD_COLOR" "ACAD_GROUP"
"ACAD_LAYOUT"
"ACAD_MATERIAL"
"ACAD_MLINESTYLE"
"ACAD_PLOTSETTINGS"
"ACAD_PLOTSTYLENAME"
"ACAD_TABLESTYLE"
"AcDbVariableDictionary"
"reactorswiz"
)
.. and know how to blow it up ..
OK, please do a test by deleting the dictionary.... look again into the entget... is not there no?.... now save the drawing and open it again.... is back or not?.... remember that the VLX must be on the same folder as the drawing
-
Like I said, entdel inside out: kill the vlo-vl object then its dictionary. Bye!
-
Like I said, entdel inside out: kill the vlo-vl object then its dictionary. Bye!
OK OK.... I did not read your post...... need glasses and more english classes.....
-
OK OK.... I did not read your post...... need glasses and more english classes.....
No prob, me too.
:P
-
This IS fun, but I have to get back to WORK guys ..
Have a couple of beers tomorrow Luis ..
(setq dictionaries (vla-get-dictionaries (vla-get-activedocument (vlax-get-acad-object))))
(vlax-for obj dictionaries
(if (vlax-property-available-p obj 'Name)
(if (= (vla-get-name obj) "reactorswiz")
(setq Whizzy obj)
)
)
)
;; //////
(vlax-dump-object Whizzy)
; IAcadDictionary: A container object for storing and retrieving objects
; Property values:
; Application (RO) = #<VLA-OBJECT IAcadApplication 00b9d604>
; Count (RO) = 1
; Document (RO) = #<VLA-OBJECT IAcadDocument 062744e0>
; Handle (RO) = "111"
; HasExtensionDictionary (RO) = 0
; Name = "reactorswiz"
; ObjectID (RO) = 2130194696
; ObjectName (RO) = "AcDbDictionary"
; OwnerID (RO) = 2130189408
;;//
(vlax-dump-object (vla-item Whizzy 0))
; IAcadObject: The standard interface for a basic AutoCAD object
; Property values:
; Application (RO) = #<VLA-OBJECT IAcadApplication 00b9d604>
; Document (RO) = #<VLA-OBJECT IAcadDocument 062744e0>
; Handle (RO) = "119"
; HasExtensionDictionary (RO) = 0
; ObjectID (RO) = 2130194760
; ObjectName (RO) = "vlo_VL"
; OwnerID (RO) = 2130194696
-
I want to thank you Luis, that was a most enjoyable challenge! I think the last time I had that much hacking fun is when I cracked the AutoCAD "student version" flag couple years back.
:evil:
-
I want to thank you Luis, that was a most enjoyable challenge! I think the last time I had that much hacking fun is when I cracked the AutoCAD "student version" flag couple years back.
:evil:
:kewl:
The walls can hear...... shhhhhhhhhh hehe
Yes.... there are some other stuff hidding.... waiting to be exposed....
-
I want to thank you Luis, that was a most enjoyable challenge! I think the last time I had that much hacking fun is when I cracked the AutoCAD "student version" flag couple years back.
:evil:
:kewl:
The walls can hear...... shhhhhhhhhh hehe
It's a matter of public record (on the desk's news server at one time). I informed Autodesk personal privately how easy it was to crack. I've never shared the info with anyone except Mr. Wengerd, nor have I ever un-edumacated any drawings. I needed to be assured we weren't getting any crap from outside sources that would corrupt our drawings, so I wrote my own utility to detect student drawings before any damage could be done. Necessity being the mother of ...
:)
-
Coffee break, so ...
Just testing what NET info I can get ..
-
LE,
I am writing a course for Autodesk University and I would like to share this code with the attendees.
I will give you and the swamp credit. Can you email me your name and response off line to peter@cordecksales.com
I also have a program that I use to upload complete lisp routines into the dictionaries of a drawing. I used a vba macro to unpack them.
With this workaround I think I can bypass the vba and make it so the routine would run automatically without the user having the option to stop the vba macro. This would give the ability to add functionality (lisp functions) to any drawing seamlessly.
I will share the finished code with who ever wants it.
Two thumbs up !!
Peter Jamtgaard P.E.
Michael,
Very impress of all your effort... all we need to do is to place on top of our lisp file a call like:
(vl-load-com)
(vlax-ldata-put "reactorswiz" "stickto_free_version" nil t)
(alert "this is only a test")
(defun C:TST ()
(alert
"I can be self loaded if you save the drawing\nAnd the next time you open it I will be back"))
Then make a protected separate namespace VLX, have our vlx place in the same folder as our drawing, load the vlx and saved the drawing and that's it....
Have fun!
Luis.
Kerry... Beers will wait for tomorrow, we are going for a wedding in Mexicali and the sun there is really something....
-
Like I said, entdel inside out: kill the vlo-vl object then its dictionary. Bye!
This seems to do the job ...
(dictremove (namedobjdict) "WhizGigetalsuperduperDict")
-
This seems to do the job ...
(dictremove (namedobjdict) "WhizGigetalsuperduperDict")
Actually that's not enough Kerry, you have to delete the the vlo-vl object then its dictionary.
If you merely delete the WhizGigetalsuperduperDict and then save the drawing, the vlo-vl object still persists (and will still function).
-
Hi Michael,
Works in my testing.
Run the (dictremove ...
Save ..
ahhh ..
The TST command will continue to be available in the Document untill the drawing is closed ..
but will not persist for the next time the document is Active.
So we may both be correct :) sort'a
-
Hi Michael,
Works in my testing.
Run the (dictremove ...
Save ..
ahhh ..
The TST command will continue to be available in the Document untill the drawing is closed ..
but will not persist for the next time the document is Active.
So we may both be correct :) sort'a
Re-Open that drawing and see what happens.
:)
-
Command: tst
Unknown command "TST".
and no in-line alert Dialog ..
-
Here's what I did yesterday --
(1) I deleted the dictionary entry, left the vlo-vl object alone, saved the dwg and re-opened it. Vlo-vl object would fire. I did this a couple times to confirm.
(2) I started over and deleted the vlo-vl object, then it's parent dictionary, saved and re-opened - quiet as a door mouse.
Today --
Just performed step (1) again for shyts and gyggles; didn't fire. Did it again, didn't fire.
Damn ghosts in the machine ...
-
hehehehe
dangers when working at the bleeding edge ..
some I know would recomend a mature bourbon.
Just a note for Luis.
Thanks. I've learnt more, and had more fun with this than has been the case for a long time ..
-
hehehehe
dangers when working at the bleeding edge ..
some I know would recomend a mature bourbon.
Yep. Still, I feel more comfortable with total eradication. :pissed:
Just a note for Luis.
Thanks. I've learnt more, and had more fun with this than has been the case for a long time ..
I second that, lotsa fun. :laugh:
-
AcDbXrecord
;;;Message Service (c)2001, John R. Fair III; $50 Bonus Winner
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Message.lsp is a program to store and retrieve
;;; information about a drawing. Use it to save notes to
;;; yourself or others, information about "odd" non-standard
;;; things you were asked to do to a drawing. Saves right in
;;; the drawing, retrieve the message the next day, next week
;;; or next year.
-
Please disregard my previous post, I was way off.
-
Please disregard my previous post, I was way off.
:-)
Still, that routine is a good one, Gary.
-
Selfload is like a virus. Please delete this topic.
-
Selfload is like a virus. Please delete this topic.
Done!
-
;;How to stop autoload of vlx?
;;I find nothing.
(vl-load-com)
(if DWGREACTOR
(vlr-remove DWGREACTOR)
)
(setq DWGREACTOR
(vlr-dwg-reactor
(vla-get-database
(vla-get-activedocument
(vlax-get-acad-object)
)
)
'((:vlr-begindwgopen . STOP_LOAD))
)
)
(if DWGREACTOR1
(vlr-remove DWGREACTOR1)
)
(setq DWGREACTOR1
(vlr-dwg-reactor
(vla-get-database
(vla-get-activedocument
(vlax-get-acad-object)
)
)
'((:vlr-enddwgopen . STOP_LOAD1))
)
)
(if DWGREACTOR2
(vlr-remove DWGREACTOR2)
)
(setq DWGREACTOR2
(vlr-editor-reactor
NIL
'((:vlr-commandwillstart . STOP_LOAD2))
)
)
(vlr-set-notification DWGREACTOR2 'ALL-DOCUMENTS)
(vlr-set-notification DWGREACTOR1 'ALL-DOCUMENTS)
(vlr-set-notification DWGREACTOR 'ALL-DOCUMENTS)
(defun STOP_LOAD (CALLER CMDSET)
(setq pp (vl-list-loaded-vlx))
(print pp)
(print CALLER)
(print CMDSET)
)
(defun STOP_LOAD1 (CALLER CMDSET)
(setq pp (vl-list-loaded-vlx))
(print pp)
(print CALLER)
(print CMDSET)
)
(defun STOP_LOAD2 (CALLER CMDSET)
(print CALLER)
(print CMDSET)
)
-
LUCAS,
What are you trying to do ?
< note WHAT not HOW >
-
Selfload is like a virus. Please delete this topic.
.. delete this topic. ..
LUCAS, can you clarify this comment. ?
< comment removed .. waiting for clarification >
-
See the autoload code of Luis.Can you stop the alert message?
If your answer is no.
You will in danger to open dwg.
If someone make a bad code (like to rename all files name & del some system files)
-
That < bad code > is an issue with any program that you are not familiar with .. VB, EXE, ARX, C#, .NET, VLX, FAS, complied LSP, etc ..
Removing this topic will not solve the problem.
Knowledge and testing WILL solve the problem.
... personal opinion.
-
I'm inclined to agree with Kerry. The tool isn't inherently evil, though it could be put to mischievous uses.
Also, how are we supposed to disarm any unruly code that makes use of the mechanism, if we don't study and understand how it works?
-
;;OK!ALL USER IN DANGER.
;;CODE FOR AUTOLOAD,BY LUCAS
(vl-load-com)
(vlr-pers (vlr-dwg-reactor
NIL
'((:vlr-enddwgopen . BEGIN)) ;ANYNAME
)
)
(defun C:BEGIN_OPEN ()
(alert "This is only a test")
(princ)
)
(alert "This is only a test")
(princ)
-
See the autoload code of Luis.Can you stop the alert message?
If your answer is no.
You will in danger to open dwg.
If someone make a bad code (like to rename all files name & del some system files)
Hi Lucas;
I understand your concern, please read the whole thread, in here is also the solution to get rid of this alternative.
:-)
-
And by the way.... this has always been part of the function vlax-ldata-put, what happens is that in the help file, is not well explained... notice the optional argument for [private] data
-
And by the way.... this has always been part of the function vlax-ldata-put, what happens is that in the help file, is not well explained... notice the optional argument for [private] data
Autoload not only using vlax-ldata-put
(vlr-pers (vlr-dwg-reactor
NIL
'((:vlr-enddwgopen . BEGIN)) ;ANYNAME
)
)
-
Sorry Lucas;
But can not understand what you are trying to say.
What is the code you posted supposed to do? and by the way it is very easy to get rid of that reactor... is that your point?
Thanks.
-
Is a FAS file.
Thanks Luis ..
.. but can we trust it ? :lol: .. you know I'm joking in this case, right !
BUT, generally unless I know <of> the author, I won't download compiled or protected code.
come to think of it, even if I 'know' the author, I still like to know WHAT a routine is actually doing before I use it .. ..
... so I s'pose I'm a little paranoid too.
afterthought : 'knowledge is power' so they say
but Imagination is more important than knowledge ... Albert Einstein
-
Is a FAS file.
Thanks Luis ..
.. but can we trust it ? :lol: .. you know I'm joking in this case, right !
BUT, generally unless I know <of> the author, I won't download compiled or protected code.
come to think of it, even if I 'know' the author, I still like to know WHAT a routine is actually doing before I use it .. ..
... so I s'pose I'm a little paranoid too.
I know is hard sometimes to get rid of some useful functions [at least to me].... anyways no big deal and to show that I am not hidding anything at all, hope that would help as in open mode... :kewl:
-
Thanks Luis,
Very generous of you, again ..
Regards
kwb
-
Sorry Lucas;
But can not understand what you are trying to say.
What is the code you posted supposed to do? and by the way it is very easy to get rid of that reactor... is that your point?
Thanks.
;;the same function of your code
;;CODE FOR AUTOLOAD,BY LUCAS
(vl-load-com)
(vlr-pers (vlr-dwg-reactor
NIL
'((:vlr-enddwgopen . BEGIN)) ;ANYNAME
)
)
(defun C:BEGIN_OPEN ()
(alert "This is only a test")
(princ)
)
(alert "This is only a test")
(princ)
Then make a protected separate namespace VLX, have our vlx place in the same folder as our drawing, load the vlx and saved the drawing and that's it....
-
Then make a protected separate namespace VLX, have our vlx place in the same folder as our drawing, load the vlx and saved the drawing and that's it....
Yep... it does the same.... NOW I understand... :-)
Now, use this:
(dictremove (namedobjdict) "VL-REACTORS")
Save the drawing and tell me if the message is gone ?
I am about to leave the office now... I'll check from home.
Cheers!
-
After opened the dwg you can use the code (dictremove (namedobjdict) "VL-REACTORS") to remove the reactor. But how can we stop autoload before open dwg.
I mean how to stop the alert code.
The part of alert code-----can do any thing you like.
-
After opened the dwg you can use the code (dictremove (namedobjdict) "VL-REACTORS") to remove the reactor. But how can we stop autoload before open dwg.
I mean how to stop the alert code.
The part of alert code-----can do any thing you like.
Hi Lucas;
I need to rebuild the test I did on my office, over there it was deleted the reactor and the alert message... you mean the ldata-> one no?
I'll be back...
-
After opened the dwg you can use the code (dictremove (namedobjdict) "VL-REACTORS") to remove the reactor. But how can we stop autoload before open dwg.
I mean how to stop the alert code.
The part of alert code-----can do any thing you like.
Just by renaming, the VLX or opening the drawing from another folder... then call the part to kill the alert code.
-
Opening the drawing from another folder….
=>The autoload code can load the vlx on the search path not just the folder of opening draw. (Test on r2005)
Just by renaming
=>we don’t know which vlx will be load.
-
Yes... I see your point...
-
I know it's only Wednesday afternoon, but it's been a long week ..
... come up with a solution.
solution To what ?
Exactly what is the problem ?
-
Wait... I just went to buy my coffee of the day.... 6:08AM Wendsday
I'll be back...
-
Opening the drawing from another folder….
=>The autoload code can load the vlx on the search path not just the folder of opening draw. (Test on r2005)
Remember that the VLX routine will be required to be loaded first and then the drawing needs to be saved first in order to be able the next time, that drawing is opened to autoload the VLX.
So, the harm can be done from any type of file loaded, not just by using this approach... if that is what someone would want to do...
Just by renaming
=>we don’t know which vlx will be load.
Same, as my comment above.... it can be using any type of file....
Have fun;
Luis.
-
Exactly what is the problem ?
None... Kerry :kewl: