Author Topic: How-To Needed: Establishing a Company CUI and Allow Other Customization  (Read 273 times)

0 Members and 1 Guest are viewing this topic.

CEHill

  • Mosquito
  • Posts: 17
To BricsCAD Power Users and CAD Administrators,

I would appreciate your experiences, tips, and other information on the subject line topic.

 :smitten:

Clint

JasonB

  • Newt
  • Posts: 37
  • perfectionist trapped inside the mind of an idiot.
I'm guessing you're looking to utilise an enterprise cui arrangement? BricsCAD doesn't currently support this option. Some info on the BricsCAD menu setup:
  • The root CUI contains the workspace options. As workspaces are user configurable the root CUI must have read/write for the user. BricsCAD will complain otherwise.
  • Workspaces in CUI other than the root are ignored. However there are options to import workspaces.
  • In recent releases, BricsCAD has introduce an interface feature allowing users to switch between different styles of menu. In effect this feature allows the user to switche to a different root CUI. I would need to check but I think the interface option is embedded, you can't disable it.
  • BricsCAD works natively with .CUI. Menus in the form of .MNU & .CUIX are converted to CUI on loading.

If you're looking to utilise a custom workspace, then i don't think there is a bullet proof solution.You could look at having a custom root cui that you would copy into the users space to give them the required read/write access. However, this also means the user can change things, destroying your customisation. You could combat this by re-copying the root cui each time they start BricsCAD, but this would also destroy any legitimate customisation made by the user, which is likely to frustate them.

Instead I would recommend maintaining the company customisation in a partial cui. This can be in a read only state if you want. You can use some LISP tools that ensure that its loaded at startup. Also by default when you load a partial its menus are propigated across all existing workspaces.
« Last Edit: April 20, 2024, 01:44:10 AM by PrinceLISPalot »

CEHill

  • Mosquito
  • Posts: 17
PERFECT!!! I thank you very much, 'Prince'! :smitten:

Clint

CEHill

  • Mosquito
  • Posts: 17
PrinceLISPalot said,
Quote
You can use some LISP tools that ensure that its loaded at startup.

QUESTIONS

1.) Could you share a sample of this partial CUI lisp code?

2.) I am familiar and use autoload statements in the on_start.lsp file. Would this partial CUI load statement be included in each user's on_start.lsp file?

3.) If not in the on_start.lsp file, where would I place the code?

Thanks,

Clint

JasonB

  • Newt
  • Posts: 37
  • perfectionist trapped inside the mind of an idiot.
Yes, on_start.lsp is a good place to check and load partial cui from.

You can make use of a S::Startup function to do those checks. e.g.

Code - Auto/Visual Lisp: [Select]
  1. (defun S::STARTUP ( )
  2.         (CCL-LOADMENU "CCL-EXTRAS" "CCL-Extras-BCAD.cui") ; Load CCL Menu if not already loaded
  3. )

CCL-LOADMENU is a function that checks if a given menugroup is loaded, and if it isn't loads it.

Code - Auto/Visual Lisp: [Select]
  1. ; CCL-LOADMENU
  2. ; Load menu will check to see if the given Menu group is loaded.
  3. ; If it isn't, then it will be loaded
  4.  
  5. (defun CCL-LOADMENU ( groupnm menufile / oACAD oMenuGrps)
  6.         (setq oAcad (vlax-get-Acad-Object)) ; retrieve Acad-Object
  7.         (setq oMenuGrps (vla-get-menugroups oAcad)) ; retrieve menugroups
  8.         (if (not (menugroup groupnm)) ; if the menugroup isn't loaded
  9.                         (if (setq menufile (findfile menufile)) (vla-load oMenuGrps menufile)) ; THEN load menu if it exists
  10.                         (vla-item oMenuGrps groupnm) ; ELSE return menu object
  11.         )
  12. )


Yet to update for V24 but we have a example setups for BricsCAD here that includes this
https://www.cadconcepts.co.nz/resources/bricscad-sample-setup

Fun fact for BricsCAD. the S::Startup function can be called multiple times from any lisp file set to autoload, such as on_start.lsp and on_doc_load.lsp. Can even be added to .mnl files.


CEHill

  • Mosquito
  • Posts: 17
Hi Jason,

Your generous reply provides ample direction. Thanks!
I also appreciate the link to the CAD Concepts samples as well. This is quite a leap in understanding for yours truly.

QUESTION
Along with your practical examples, can you recommend additional web sources of learning to better understand the purpose and example uses for the S::Startup function?
So far, the above topic remains the most elusive of CAD topics to me
.

G-day mate,

Clint Hill


Yes, on_start.lsp is a good place to check and load partial cui from.

You can make use of a S::Startup function to do those checks. e.g.

Code - Auto/Visual Lisp: [Select]
  1. (defun S::STARTUP ( )
  2.         (CCL-LOADMENU "CCL-EXTRAS" "CCL-Extras-BCAD.cui") ; Load CCL Menu if not already loaded
  3. )

CCL-LOADMENU is a function that checks if a given menugroup is loaded, and if it isn't loads it.

Code - Auto/Visual Lisp: [Select]
  1. ; CCL-LOADMENU
  2. ; Load menu will check to see if the given Menu group is loaded.
  3. ; If it isn't, then it will be loaded
  4.  
  5. (defun CCL-LOADMENU ( groupnm menufile / oACAD oMenuGrps)
  6.         (setq oAcad (vlax-get-Acad-Object)) ; retrieve Acad-Object
  7.         (setq oMenuGrps (vla-get-menugroups oAcad)) ; retrieve menugroups
  8.         (if (not (menugroup groupnm)) ; if the menugroup isn't loaded
  9.                         (if (setq menufile (findfile menufile)) (vla-load oMenuGrps menufile)) ; THEN load menu if it exists
  10.                         (vla-item oMenuGrps groupnm) ; ELSE return menu object
  11.         )
  12. )


Yet to update for V24 but we have a example setups for BricsCAD here that includes this
https://www.cadconcepts.co.nz/resources/bricscad-sample-setup

Fun fact for BricsCAD. the S::Startup function can be called multiple times from any lisp file set to autoload, such as on_start.lsp and on_doc_load.lsp. Can even be added to .mnl files.