Author Topic: Is there a way to package CUI with Autolisp application .vlx?  (Read 2754 times)

0 Members and 1 Guest are viewing this topic.

SIDESHOWBOB

  • Guest
Is there a way to package CUI with Autolisp application .vlx?
« on: February 29, 2012, 06:47:05 AM »
I see it is possible to load an interface for my application using (command "_MENULOAD" "myapp.cuix"), but I can't see where to add the .cuix file to the application package.  Is this possible somehow?  The desired result is that when I load my application into autocad, I'd like a ribbon tab to appear with the buttons to control it.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Is there a way to package CUI with Autolisp application .vlx?
« Reply #1 on: February 29, 2012, 10:25:11 AM »
Not that I know of; every product I've seen has separate CUIx file(s), along with a DLL for the images.  If you want to spend the time on it, you could embed a function in the VLX which generates the contents of a CUI file on the fly but that would make for an unnecessarily large program file.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

SIDESHOWBOB

  • Guest
Re: Is there a way to package CUI with Autolisp application .vlx?
« Reply #2 on: February 29, 2012, 10:48:36 AM »
Thanks.  No I don't want to do anything nonstandard - so in that case, how do I find the path to the CUIx file from lisp so I can call MENULOAD?

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Is there a way to package CUI with Autolisp application .vlx?
« Reply #3 on: February 29, 2012, 12:34:46 PM »
Just specify that it has to be in the AutoCAD search path and let the end-user locate it where *they* want to.  You can get clever with all sorts of ways of pointing to it otherwise, from configuration files, to registry entries, to automatically adding your required folders to the end of the existing search path, to having a hard-coded program file path, but those can make life difficult for the end user.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

SIDESHOWBOB

  • Guest
Re: Is there a way to package CUI with Autolisp application .vlx?
« Reply #4 on: March 02, 2012, 11:42:56 AM »
Does the cuix file not contain the icons it uses on the ribbon?  It seems to work alright for me.

If I wanted to access the registry from visual lisp, can that be done?  I could always make a key with the path to my cuix when the installer runs.  What's wrong with that approach from your point of view, does calling _MENULOAD every time the app is loaded somehow mess things up for the user?

Lee Mac

  • Seagull
  • Posts: 12925
  • London, England
Re: Is there a way to package CUI with Autolisp application .vlx?
« Reply #5 on: March 02, 2012, 11:57:29 AM »
If I wanted to access the registry from visual lisp, can that be done?

Certainly, functions:

Code - Auto/Visual Lisp: [Select]

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Is there a way to package CUI with Autolisp application .vlx?
« Reply #6 on: March 05, 2012, 02:22:18 AM »
Also as long as the CUI is already loaded you can obtain its path through ActiveX. My method is actually the other way round than yours: I've got the CUI(x) loaded, then I get to the LSP/FAS/VLX files from there.

See my code here: http://caddons.svn.sourceforge.net/viewvc/caddons/Caddons.MNL?revision=62&view=markup
The Caddons:Path defun (line 106) extracts the path from the loaded CUI. Then the others (like my re-written Caddons:Load on line 136) uses this path to get hold of the relevant LSP/FAS/VLX.

That way I could package all into an installer (say using InnoSetup - because it has a Pascal-like script language). All that's then needed for the installer to do is modify the registry to add the CUI to acad as a partial (or whatever else). No need to fiddle with Support Paths / add acad.lsp/acaddoc.lsp/S::Startup/etc.

You could even try the AcadInst routine which makes the registry edit for acad a lot simpler. Though you'd need to buy it if you don't want all those nag-screens.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.