Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to attach a lisp file to a particular drawing file without loading?

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
1807 Views, 6 Replies

How to attach a lisp file to a particular drawing file without loading?

Hello Gentlemen,

I am a CAD in-charge for a particular project. The Drawing files are located in server (Many users  will work on that files). I would to keep a record that which user (and which date) has opened a particular drawing file in Notepad file. I am having a lisp program file to do that job. But it is working only with my computer when I upload that file (or startup suite). But many users are also there to work in that same file. My question is that, Is there any possibility to attach a lisp file to a particular drawing file without loading? If any user opens the drawing file, I can easily know from the recorded in notepad.

Solution using .Net are also welcome.

Thanks in Advance

Tags (1)
6 REPLIES 6
Message 2 of 7
stevor
in reply to: Anonymous

I am a bit confused by the grammar, but consider: 1 . The program: "many users are also there to work in that same file. " If you mean that many 'users' will edit the lisp or .net program file, then that it should be also on the server, with the project data. However, many program editors is risky; better make many backups. If you want no one to edit the program code, then use some encryption or make it a VLX. 2. The attachment of the code can also be done by storing the text inside the drawing several ways, as others may soon post. 3. The automatic 'load' of the lisp or net program might be done by a reactor within the drawing, but reactors have complications. One common common solution is to provide the users with lisp routine that loads .lsp or .net from the appropriate project folders.
S
Message 3 of 7
Anonymous
in reply to: Anonymous

 

!

 

Message 4 of 7
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:


I think similar questions have been raised before, but I'm not sure just what to Search for, or whether any are quite the same thing.  But here's a thought....

 

Make a drawing called something distinctive, such as OpenLogRecord.dwg, which contains no drawn content.  Insert that into any drawing that you want to keep track of in this way, at any insertion point and scales and rotation.  Assuming you have a server-based acaddoc.lsp file that does its thing for all Users on opening any drawing, include in that a function like this:

 

(if (tblsearch "block" "OpenLogRecord")

  (....do what it does ....)

)

 

Since the drawing [a Block within any drawing it's Inserted into] contains no drawn content, it can't be Erased by object selection, and therefore can't be Purged out of the drawing unless it's removed by certain other means that probably only pretty sophisticated Users would be able to pull off, such as finding it with (ssget) if they know its name.  [A less sophisticated way would be Erase All, if the User is in the same drawing space in which it was Inserted, but no one's going to do that.]  And when you get to a point where you don't want to keep such a record for a particular drawing, you can remove that Block using (ssget), and Purge its definitioin, and it will no longer trigger entries into the record.

 

That should do it for any drawing in which that is Inserted, but for no other drawings, so you won't end up with record files about a lot of drawings you don't want to keep such track of.

Kent Cooper, AIA
Message 5 of 7
dgorsman
in reply to: Anonymous

Your drawings are on a server, so everybody can access them, right?  Do the same with your LISP files.  Standardize the start-up routine so everybody is running the same ACAD.LSP and ACADDOC.LSP files, which will ensure specific LISP files are loaded and settings are made.

 

You will never be able to get code to run without loading (think about it), and while you kinda-sorta can "embed" LISP into a DWG file that can lead to VERY BAD THINGS.  Much better to go to a centralized standard set-up for all users.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 6 of 7
Anonymous
in reply to: Anonymous

Thank you very much , , and

Message 7 of 7
hgasty1001
in reply to: Anonymous

Hi,

 

It's no clear to me why a pure AacadXXdoc.lsp solution it's not enough?, i'm thinking in something like :

 

(setq CurrentDWG (getvar "DWGNAME")

(if (= currentDWG SomeDWgToTrack) ;this condition could be changed to a list of dwg to be tracked

  (some stuff here, for example log user data)

 

That code will run every time AutoCAD open a drawing.

 

Gaston Nunez

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost