Jump to content

CUI to unload LISP


Randolph

Recommended Posts

As described before, I use a long LISP of commands, which I APPLOAD or put in the START GROUP of my office computer.

 

With my boss, we often work on the same computer on the same project alternately. But my boss uses more buttons and different shortcuts than me, which always makes one of us nervous.

 

So I made a CUI for him and one for me, which makes switching the TOOLBOXES quite easy.

 

Problem: If I have loaded the LISP once, it does not unload when switching the CUI, and his PGP shortcuts are still overruled by my LISP shortcuts, making him swear and shout.

Link to comment
Share on other sites

  • Replies 36
  • Created
  • Last Reply

Top Posters In This Topic

  • alanjt

    16

  • Randolph

    15

  • JeepMaster

    4

  • The Buzzard

    1

As described before, I use a long LISP of commands, which I APPLOAD or put in the START GROUP of my office computer.

 

With my boss, we often work on the same computer on the same project alternately. But my boss uses more buttons and different shortcuts than me, which always makes one of us nervous.

 

So I made a CUI for him and one for me, which makes switching the TOOLBOXES quite easy.

 

Problem: If I have loaded the LISP once, it does not unload when switching the CUI, and his PGP shortcuts are still overruled by my LISP shortcuts, making him swear and shout.

 

 

Under options try Profile.

 

Controls the use of profiles. A profile is a configuration you define.

 

 

Available Profiles Displays a list of the available profiles. To set the current profile, select a profile and choose Set Current.

 

Set Current Makes the selected profile the current profile.

 

Add to List Displays the Add Profile dialog box to save the selected profile under a different name.

 

Rename Displays the Change Profile dialog box for changing the name and description of the selected profile. Use Rename when you want to rename a profile but keep its current settings.

 

Delete Deletes the selected profile (unless it is the current profile).

 

Export Exports a profile as a file with an .arg extension so the file can be shared with other users. You can import the file on the same computer or a different computer.

 

Import Imports a profile (a file with an .arg extension) created by using the Export option.

 

Reset Resets the values in the selected profile to the system default settings.

Link to comment
Share on other sites

After re-reading your first post, you can try not use appload to load your lisp, instead load them under your cui. I think it's a much better way to keep your customization. The few times that my computer got switched, all I need to do is import my cui file and all the lisp, toolbars, and shortcuts are loaded.

Link to comment
Share on other sites

Thanks guys for all your comments.

 

Jeepmaster, because we discuss a design and and rework it. It's kind of sketching, and when we're content, I make a clean drawing. Or my boss has an illumination, jumps at me, throws me off the chair and takes control of my work. No time for restarting. Architects, you know. ;)

 

I have to see what you mean by "loading my lisp under the cui". The point is rather, how to unload the lisp with another cui.

 

If I get you right, to customize, you need at least 3 files to save on the machine - cui, lisp and pgp. I don't use the acad.pgp any more for simplification, as it is overruled by the lisp anyway. I don't use toolbars to work with either, except for the layer control. I use my cui just to remove most toolboxes to get screen space.

 

Alanjt, Buzzard, I will work through the profiles and see what they can do - thanks. I guess you must get the impression of a really - let's call it: alternative - way of working with acad. Well, architects, as I said before ...

Link to comment
Share on other sites

[

I have to see what you mean by "loading my lisp under the cui". The point is rather, how to unload the lisp with another cui.

If you look under your cui tree, you should have a lisp section. That's where I keep all my lisp files. It loads them automatically. I don't use appload. Eitherway, when I tried to unload my cui. All my lisps are still loaded, but once I restart autocad, all my lisp are unloaded. So that might still not help you.

According Autodesk, lisp cannot be unloaded. For the trouble, might as well restart autocad and be done with. Only takes about a few seconds to restart once it's loaded in the memory.

Link to comment
Share on other sites

OK ... seems to be that way.

 

Workaround might be to write a LSP with my bosses PGP commands and load it when changing CUIs (still don't know how this is exactly done). This should overwrite at least those of my commands with the same shortcut. What you think guys? Worth a try?

Link to comment
Share on other sites

OK ... seems to be that way.

 

Workaround might be to write a LSP with my bosses PGP commands and load it when changing CUIs (still don't know how this is exactly done). This should overwrite at least those of my commands with the same shortcut. What you think guys? Worth a try?

 

Yeah, if you are going to continue to use lisp for shortcuts, you'll have to do the same for your boss.

 

You could have a selection interface at startup that asks for your or your boss. Then it loads the required profile and lisp routines. It would be real simple, you'd just need a selection box with your name and your boss'.

Link to comment
Share on other sites

We're getting close to a solution. Thanks to all so far.

 

Still, I would prefer if I could call this via command (like SWC for switch cui - i love to use the keys on the left -thinking of it, CSW would be faster). But I have no glimpse of an I idea how to start this. My LISP knowledge is limited to writing batches of few commands. Who can help me? As universal exchange of aid, I will help some 3D newbies which haven't left 4 years ago ... (shame).

 

Procedure in sketch:

 

1) Write lisp with other commands for the same shortcuts. Call "acad-boss.lsp" and copy to C:/Programs/ACAD/Lisp/acad-boss.lsp

2) Make cui for boss for his personal toolboxes.

3) Copy the following routine to both lisps:

 

(DEFUN C:CSW ...

 

a) Enter CSW

b) in the command line appears: Choose profile [boss/Slave/Gamp]: B and ENTER

c) The Toolbars and lsp-commands are changed. The former could be done somehow via the _options dialogue, the latter is done by loading the respective lisp, internally overwriting the commands of the former lisp.

 

Could this work, or am I talking rubbish?

Link to comment
Share on other sites

Maybe something like this (completely untested):

 

(defun UserStartup (/ ProfileLoad #Choice)

 (vl-load-com)

 (defun ProfileLoad (#ProfileName / #Profiles)
   (setq
     #Profiles
      (vla-get-profiles (vla-get-preferences (vlax-get-acad-object)))
   ) ;_ setq
   (or (eq #ProfileName (vla-get-activeprofile #Profiles))
       (not (vl-catch-all-error-p
              (vl-catch-all-apply
                'vla-put-activeprofile
                (list #Profiles #ProfileName)
              ) ;_ vl-catch-all-apply
            ) ;_ vl-catch-all-error-p
       ) ;_ not
   ) ;_ or
 ) ;_ defun

 (initget 0 "Randolph Boss Dismiss")
 (and (setq #Choice
             (getkword
               "\nUser customization options to load [Randolph/Boss] <Dismiss>: "
             ) ;_ getkword
      ) ;_ setq
      (cond
        ((eq #Choice "Randolph")
         ;; do stuff
         (ProfileLoad "Randolph")
         (and (findfile "Randolph.lsp") (load "Randolph.lsp"))
        )
        ((eq #Choice "Boss")
         ;; do stuff
         (ProfileLoad "Boss")
        )
      ) ;_ cond
 ) ;_ and
 (princ)
) ;_ defun

This will prompt you at startup to choose a user (your or your boss) or just dismiss and continue loading. Based on the user chosen, it will perform specific tasks. I've also written a little subroutine that will load the active profile.

 

I wouldn't call your .lsp file acad.lsp, since you don't want it to autoload for you boss, or just put it in a non-support directory and just specify the full location in the load portion of the routine.

Link to comment
Share on other sites

I'm impressed with your speed of work and I don't want to appear ungrateful, but I'm afraid we worked crosswise right now. What's your comment on the lines I posted before?

 

If I get your documentation right, your routine will force me to do something extra at startup. Also, how can I switch on the fly without restart? That's the point.

 

I guess, that there might be a general need for this: easily switch user profiles with lisp functionalities on the fly.

 

I will call my lsp acad-ralph.lsp or something.

Link to comment
Share on other sites

I'm impressed with your speed of work and I don't want to appear ungrateful, but I'm afraid we worked crosswise right now. What's your comment on the lines I posted before?

 

If I get your documentation right, your routine will force me to do something extra at startup. Also, how can I switch on the fly without restart? That's the point.

 

I guess, that there might be a general need for this: easily switch user profiles with lisp functionalities on the fly.

 

I will call my lsp acad-ralph.lsp or something.

 

 

Yes, this would prompt you at startup (which can be bypassed). The easiest way to make the live swap, would be to save (if needed) then type Revert.

Link to comment
Share on other sites

What I wrote is basically what you are asking for in the previous post. You could call it whenever you wanted. Just change this line:

 

(defun UserStartup (/ ProfileLoad #Choice)

To:

(defun c:CSW (/ ProfileLoad #Choice)

 

Problem is, when you load your routines, if your boss comes over and wants to work, he can't 'unload' them w/o restarting Autocad.

Link to comment
Share on other sites

have you thought of just changing your lisp names, im sure you've gotten used to them, but it seems easier then all this and then your lisps can be loaded and not effect him or vice versa change his and you wont have a problem

Link to comment
Share on other sites

have you thought of just changing your lisp names, im sure you've gotten used to them, but it seems easier then all this and then your lisps can be loaded and not effect him or vice versa change his and you wont have a problem

If he's going to do that, why not just use out-of-the-box command aliases? I'd much rather do a little legwork on the front end to keep the macros that make my life easier. I would never trade down R (rotate) and D (dist) and revert back to RO and DI.

Link to comment
Share on other sites

The biggest thing that puzzles me is why people don't use the number key row.

~ = qleader
1 = layer current
2 = layer set
3 = layer off
4 = layer freeze
5 = mleader
6 = civilpointmodlist (old LDD command, need to update since I use C3D now)
7 = list
8 = layerp
9 = extrim
0 = math (commandline calculator)
- = layer nuke
= = never defined, but could be used

Link to comment
Share on other sites

Hi Chelsea,

 

i have a system of commands.

 

d ... duplicate

dx ... duplicate in x-direction

dxm ... duplicate in x-direction multiple times

df ... duplicate fixed - no offset

dfm ... i guess you know by now (useful command if you need to substract 1 volume from multiple other volums without welding them).

 

s ... slice (most used command after l)

sx ... slice parallel to yz-plane

 

and so on.

 

a ... abstand (= distance)

 

So, all my shortcuts can be easily done with the left hand. I also use the logitech dinovo desktop, because i put its detached number block on the left. thus, i never have to let go of my mouse. in short, I'm quite happy with may system. Never change a running system ...

 

Alan,

 

"he can't 'unload' them" - that's what I hope will work by loading a contradicting lisp. I have to try this out with appload. In the end, the new CSW command would just have to batch 2 commands:

 

DEFUN C CSW:

Choose profile [boss/Ralph]: B

Routine does:

a) options > profile > load profile "boss"

b) appload l> load acad-boss.lisp

Link to comment
Share on other sites

Hi Chelsea,

 

i have a system of commands.

 

d ... duplicate

dx ... duplicate in x-direction

dxm ... duplicate in x-direction multiple times

df ... duplicate fixed - no offset

dfm ... i guess you know by now (useful command if you need to substract 1 volume from multiple other volums without welding them).

 

s ... slice (most used command after l)

sx ... slice parallel to yz-plane

 

and so on.

 

a ... abstand (= distance)

 

So, all my shortcuts can be easily done with the left hand. I also use the logitech dinovo desktop, because i put its detached number block on the left. thus, i never have to let go of my mouse. in short, I'm quite happy with may system. Never change a running system ...

 

Alan,

 

"he can't 'unload' them" - that's what I hope will work by loading a contradicting lisp. I have to try this out with appload. In the end, the new CSW command would just have to batch 2 commands:

 

DEFUN C CSW:

Choose profile [boss/Ralph]: B

Routine does:

a) options > profile > load profile "boss"

b) appload l> load acad-boss.lisp

 

The routine I posted will cover all of that.

Link to comment
Share on other sites

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...