TheSwamp

CAD Forums => CAD General => BricsCAD Users => Topic started by: CEHill on April 19, 2024, 07:54:52 AM

Title: How-To Needed: Establishing a Company CUI and Allow Other Customization
Post by: CEHill on April 19, 2024, 07:54:52 AM
To BricsCAD Power Users and CAD Administrators,

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

 :smitten:

Clint
Title: Re: How-To Needed: Establishing a Company CUI and Allow Other Customization
Post by: JasonB on April 19, 2024, 05:38:20 PM
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:

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.
Title: Re: How-To Needed: Establishing a Company CUI and Allow Other Customization
Post by: CEHill on April 21, 2024, 05:12:19 PM
PERFECT!!! I thank you very much, 'Prince'! :smitten:

Clint
Title: Re: How-To Needed: Establishing a Company CUI and Allow Other Customization
Post by: CEHill on April 29, 2024, 08:14:44 AM
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
Title: Re: How-To Needed: Establishing a Company CUI and Allow Other Customization
Post by: JasonB on April 30, 2024, 06:18:49 AM
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.

Title: Re: How-To Needed: Establishing a Company CUI and Allow Other Customization
Post by: CEHill on April 30, 2024, 06:55:36 AM
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.