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

Custom Commands

30 REPLIES 30
SOLVED
Reply
Message 1 of 31
Anonymous
1876 Views, 30 Replies

Custom Commands

We had a person here at work that wrote a lot of custom menus and comands that did such things as inserting blocks changing layers and a more complicated routine that would draw lines, insert blocks, insert text based on user input.  That person is no longer with the company and I would like to make some changes to those custom commands but I don't know what files they are in.  I have found the custom menus but i don't know where the custom commands are coming from.  Can anyone help. Thanks.

30 REPLIES 30
Message 2 of 31
pendean
in reply to: Anonymous

Post one of these customizations and describe what you want to change.
Message 3 of 31
dgorsman
in reply to: Anonymous

They could be coming from a LISP file, a VB6 DLL or EXE file, a dotNET DLL or EXE, a VBA DVB module, or possibly even an ObjectARX ARX file.

 

If it was done in LISP, then they could be defined in an LSP or MNL file - both the same thing, different extensions.  It could also be in a FAS or VLX file, which are compiled so unless you have the source code you are pretty much hooped.

 

If this was done with VB6, dotNET, or ObjectARX then you will definitely need the source code to do anything.  If it was done with VBA, then the DVB file cannot be password protected.

----------------------------------
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 4 of 31
Anonymous
in reply to: pendean

An example of the custom commands is one called "Strand" which can be envoked by pull down, tool bar button ot just type Stand at the command prompt.  This routine  inserts blocks representing telephone poles and connects them with a line and inserts text representing the footage between them.  The user is prompted for the footage between the poles, what type of pole, and the direction it should be drawn. I may want to make some improvements to it but I first need to know where to find it.  I've looked through every .lsp file we have and I don't see it.  I've also looked through the VBA files and can't seem to find it there either.  Don't know where else to look.

Message 5 of 31
dgorsman
in reply to: Anonymous

One of the overlooked things in software development is documentation.  And one of the things overlooked in documentation is not just how to operate the program but how to set it up as well.  If that information isn't there, you'll have to start digging into the software to find out what is being loaded, from where, using what means.  That will determine where the functions are defined.

 

If you cannot understand where things are coming from, you may need to accept that you don't understand enough to make the desired modifications.

----------------------------------
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 31
dmfrazier
in reply to: Anonymous

"...I don't know what files they are in. I have found the custom menus but i don't know where the custom commands are coming from."

What version of AutoCAD are we talking about? Pre- or post-CUI?

When you say you have "found the custom menus", please explain what you mean.  Do you mean you have found the place in a particular CUI (or MNU) where certain "commands" are defined?

Once we have a better picture of where you are starting from, we will be able to better guide you (but it's going to be a long haul, I'm afraid).

 

Message 7 of 31
pendean
in reply to: Anonymous

Start CUI command.
Do and find the button or icon you click on in the top right pane, then click on it.
The left pane will then populate with more information about what you are selection.
Post a screenshot of the entire CUI pop-up showing this information.

I am going to rely on your ability to figure it out using HELP inside AutoCAD on how to use CUI command. If you don't try you won't learn: it's critical for what you want to do. Study up and post what I asked.

We look forward to helping you out further.

Message 8 of 31
Anonymous
in reply to: pendean

I looked at the cui and for the command I'm looking at ("strand") the only clue I see is under macro it says ^C^Cstrand.  when I click on that it brings up the Long String Editor window. 

 

I've also looked at what applications are loaded and there are 2 dvb files, 4 vlx, and 1 lsp.  I'm starting to think it's in one of the vlx files.

 

Would the source code file and the vlx file have to have the same name?

 

Once the source code was compiled could it have been deleted?

 

Posting screen shots for the cui and appload.

 

pendean, thanks for the encouragement about learning. My intention is to learn as much about AuotCAD as I can. 

Message 9 of 31
dmfrazier
in reply to: Anonymous

Because the macro in the CUI runs the "strand" command without loading it (within the macro), this means it is loaded somewhere else, which could be via the "Startup Suite", an MNL file that accompanies the CUI, or in some other startup file (e.g. ACAD.lsp).

The APPLOAD command allows you to load apps as well as see which ones are currently loaded.  In the "appload.jpg" image you posted, the files listed in the upper window (in the "Lisps" folder) are not necessarily apps that have been loaded.  To see which ones are actually loaded, scroll up and down in the "Loaded applications" list near the bottom.  "Strand" will only show up here if it is loaded independently, such as from its own LISP or ARX file, and if the file name matches the function name.  (No, they don't have to match.)  If the function is defined and loaded as a part of another application, it will not show up here.

Yes, the source code could have been deleted (or lost, or simply "put away for safekeeping").

Message 10 of 31
Anonymous
in reply to: Anonymous

I opened one othe .vlx files in notepad and on the first line was this:

 

(:load-file-list (:fas "ReplaceTag") (:fas "cpa_KeyBuilder") (:fas "UG-Only") (:fas "ActiveReport") (:fas "Comcast") (:fas "FiberTracking") (:fas "conduit") (:fas "keybuilder") (:fas "chtext") (:fas "MTextNotes") (:fas "FiberCalculator") (:fas "QuickPlot") (:fas "xrefs") (:fas "WAREHOUSEDRAFT") (:fas "STRAND") (:fas "STRETCHSTRAND") (:fas "UTILITY") (:fas "R13FILES") (:fas "OFFSETPT") (:fas "LEGENDBOM") (:fas "MAINSUB") (:fas "MYLAR") (:fas "MylarRev") (:fas "LABELLINE") (:fas "INSERTCOMMANDS") (:fas "CCInsert") (:fas "CHKBLOCK") (:fas "DRAWLINES") (:fas "CCBOM") (:fas "Captaddr")))

So it looks like this is where all the custom commands are loaded as .fas files which I know are compiled Lisp programs.

Since they are listed seperatly does that mean each one would have it's own Lisp program or could they be part of one big program?

Message 11 of 31
dmfrazier
in reply to: Anonymous

"Since they are listed seperatly does that mean each one would have it's own Lisp program or could they be part of one big program?"

Every item inside quotes following :fas (e.g. " (:fas "STRAND") ") is a separate FAS file.  Each of these FAS files may define one or more functions.

Message 12 of 31
Anonymous
in reply to: dmfrazier

I've searched my entire hard drive and there are no .fas files with the names of the ones that are in that first line of the vlx file.  Also searched for .lsp and .mnl and got the same results.I'm not sure where else I could search for the .fas files or there source code.

Message 13 of 31
dmfrazier
in reply to: Anonymous

Are any of your support paths (current or past) on network drives?  (Or a removable drive?)

If not, then I'm afraid I've reached my level of incompetence.Smiley Frustrated

Message 14 of 31
Anonymous
in reply to: dmfrazier

No, none of the support paths are on a network drive. 

We'll I think I've reached the end of the line.  Thnaks everyone for your help.

Message 15 of 31
Anonymous
in reply to: Anonymous

No, you haven't- just as he was able to go into autocad and customize it you are able to go back into it and customize to a prior state. Just locating the files to remove/modify is obviously the tricky part if you're doing it without prior knowledge of the files or even their locations.

You're getting close with the appload, in the "startup Suite" is where you will likely find the names of the files that he has added customized lisp into. The .fas are 'compiled' and encrypted so if he's got alot of .fas files where these commands are coming from, then you will simply have to delete it out of your startup suite to stop it from being loaded.

Make a copy of the file before you delete it from the folder where it resides just in case anything doesn't work correctly or as intended you can un-do your un-doings.

The files will be located in the folder structures outlined in the support file search path, and they will likely be in a list of files found in the "startup suite" of the appload command, so do some matching and locate the files within the search paths. I'd just search for ".lsp" once browsed to a support folder, also do a search for ".fas" and ".arx", see which ones are in your startup suite. Remove one from the startup suite, restart autocad, and then check the command that you are trying to remove. If it's still there, rinse and repeat.....

That's how i'd go about it at least, all the info is there in front of you, and despite .fas files being encrypted there are methods to determine if they are required or not- i don't think autocad comes with any .fas files OOTB but that's why you'd want to make copies of things and remove them from startup suite before outright deleting them from your system. Hopefully this allows you some progress

Message 16 of 31
Anonymous
in reply to: Anonymous

There is a .lsp and a .vlx in the list of loadad applications but they are greyed out how do I unload those?

When I clicked on the contents of the Starup Suite and it was empty.

Message 17 of 31
Anonymous
in reply to: Anonymous

I opened the acaddoc.lsp file and saw where the .vlx apps are loaded.  I put a semi-colon in front of it to prevent it from loading and my custom commands stoped working.  So I found the file that loads the commands but I can't find the source code for that particular vlx file.  The person who wrote them no longer works for the company and I have a feeling he took the files with him or deleted them or has them hidden somewhere.

Message 18 of 31
matt.worland
in reply to: Anonymous

A lisp can not be unloaded. But look at the location of the file and then rename the vlx extension so AutoCAD does not load it. Then as bhull1985 has mentioned, you can test to see if the command you want is in that file. If it is in the vlx, you are out of luck, but if not, it may be in the lsp. You can open the lsp file and do a search for the command name you are looking for to see if it is in there and modify as needed.

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"
Message 19 of 31
Anonymous
in reply to: Anonymous

Now that you have removed them from loading onto your systems you can go into the CUI and simply delete out the menu items, and besides the files residing on your system somewhere (which is likely harmless, do a malicious file scan or two if you want to be sure) you'd have succesfully undone what he's added.

Message 20 of 31
dmfrazier
in reply to: Anonymous

If I may, from the original post:

 

"I would like to make some changes to those custom commands but I don't know what files they are in. I have found the custom menus but i don't know where the custom commands are coming from."

 

Where did you get the idea that the OP is interested in removing the customizations?  I think the OP wants to keep them (because they are likely very valuable routines), but wishes to be able to modify them.  Unfortunately, it appears the creator of these customizations has used some relatively sophisticated methods and has only left behind the compiled fruits of his/her labors.

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

Post to forums  

Autodesk Design & Make Report

”Boost