Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Loading workspaces via Application Plugin

1 REPLY 1
SOLVED
Reply
Message 1 of 2
JohnDutz
874 Views, 1 Reply

Loading workspaces via Application Plugin

I am working on porting some customization that was developed around 15 years ago into AutoCAD 2015+.  The installation file only works, and the application is only supported in AutoCAD 2013. The original author has no plans to update the application at this time.  Reverse engineering and re-writing the application does not violate the TOU.  I have a user group dependent on it, though, so an update is required before I can upgrade AutoCAD corporately.

 

The original application swapped MNU files to create what are, essentially, workspaces.  There are 15 pull-down menus, with dozens of lisp commands in each menu and a dozen or so toolbars.  There is one menu that allows the user to swap out partial menu files (MNU) to control which UI elements are visible.  I would like to avoid rebuilding the UI to use ribbon tabs, toolbars, etc.  I can make it work by updating the CUI to use workspaces but I can't figure out a way to load the workspaces.

 

I would prefer to have this application load using the Autoloader (copy it to the workstation, switch workspaces, voila!).  Ideally, we would not have to worry about updating this application in the future, aside from minor changes to the PackageContents.xml file.  So far, I have most of it working - lisp routines, executables, etc. load just fine.  None of the scripts or executables are dependent on a particular version of AutoCAD. 

 

tldr:

 

Can I load workspaces from a partial CUI using the Autoloader?  If so, how do I do it? or, is it possible to configure the Main / Enterprise CUI using the Autoloader?

 

Does anyone out there have any tricks I maybe haven't considered?

1 REPLY 1
Message 2 of 2
rapidcad
in reply to: JohnDutz

Hi John, seems like I can get you started but there looks to be some missing details.

Let me see how far we can get.

Yes, an autoloader (ACADDOC.lsp or YOURMENU.mnl) can define the program to swap workspaces, and more:

(command "_.workspace" "_C" "MYCUSTOMWORKSPACENAME") can easily be made a function, or this code can be executed from a button in a toolbar if that works as well. Swapping out MNL files can also be done with programming. I prefer to use profiles to do so, but the enterprise cui is available to swap via the visual lisp extensions like so:

 

(setq FILEPREFs (vla-get-files (vla-get-preferences (vlax-get-acad-object))
      )
    )

 

then..

 

(vla-put-EnterpriseMenuFile fileprefs  "C:\\MYPATHPARENTFOLDER\\MYPATHCHILDFOLDER\\MYMENUFOLDER\\MYMENU")

 

You don't need to specify the extension on the menu, just the name (tested with CUIX).

There is more to share like R. Robert Bell's classic idea to make your own blank CUI file and populate it with your customizations, then set it as your main menu and load ACAD and EXPRESS as partials to main. This allows easy upgrading version to version without losing your customizations.

I'm sure there are more questions. See if this can get you started.

ADN CAD Developer/Operator

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report