Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Enterprise CUI

  1. #1
    100 Club
    Join Date
    2008-03
    Posts
    156

    Default Enterprise CUI

    Hey guys,

    My Background:
    1 year drafting cert, no real programming knowledge.
    CAD Lead for 50 people (about 10 months now).
    You guys have been such a fantastic help in helping me learn lisp.
    Unfortunately, I am stuck again.

    My Work Situation:
    I am running a fair sized group in a much larger company.
    The company doesn't provide perfer tools, nor do they handle stuff at the client level.
    That's my job.

    My Tech Situation:
    - AutoCAD 2008 (vanilla)
    - Corporate addon with menus and dialogue boxes
    - Client addon with toolbar.

    Seems like both the Corporate and Client addons show up in the CUI Manager as partial CUIs.

    My Problem:
    What i have been trying to build is an Enterprise CUI.
    I want it to load the Corporate and Client addons, then run my lisp.


    I have my entire lisp within a s::startup command.

    Code:
     
    ;---------- Load Applications ----------
    ;
    (defun s::startup()
    (load "annoallvisibleoff")
    (load "viewportlock")
    ;(load "xreflock")
    ;
    ;
    ;------ GENERAL SYSTEM VARIABLES ----------
    ;
     (setvar "annoautoscale" -1)
     (setvar "demandload" 3) ;loads external applications to manipulate 3rd party objects. ex. excel tables. 
     (setvar "dimassoc" 2)
     (setvar "dragmode" 2)
     (setvar "expert" 1) ;Suppresses “About to regen, proceed?” and “Really want to turn the current layer off?” (-LAYER)
     (setvar "fieldeval" 31) ;fields update on open, save, plot, etransmit, regeneration
     (setvar "fontalt" "simplex.shx")
     (setvar "grips" 1) 
     (setvar "isavepercent" 0)
     (setvar "maxactvp" 64)
     (setvar "maxsort" 1000)
     (setvar "mirrtext" 0)
     (setvar "mtexted" "internal")
     (setvar "mtextfixed" 2)
     (setvar "osnapnodelegacy" 0)
     (setvar "osoptions" 3)
     (setvar "peditaccept" 1)
     (setvar "proxynotice" 0)
     (setvar "publishcollate" 0)
     (setvar "regenmode" 1)
     (setvar "visretain" 1)
     (setvar "savetime" 10)
     (setvar "selectionannodisplay" 1) 
     (setvar "selectionpreview" 3)
     (setvar "setbylayermode" 127)
     (setvar "snapmode" 1)
     (command "snap" "5")
     (setvar "ucsicon" 3)
     (setvar "visretain" 1)
     (setvar "vplayeroverridesmode" 1)
     (setvar "xloadctl" 2)
     (setvar "xrefnotify" 2)
     (setvar "xreftype" 1)
    ;
    ;
    ;------ LINETYPE SYSTEM VARIABLES ----------
    ;
     (setvar "celtscale" 1)
     (setvar "ltscale" 0.5)
     (setvar "msltscale" 1)
     (setvar "psltscale" 1)
    ;
    ;
    ;------ MAKE THE DRAWING EASY TO WORK WITH ----------
    ;
     (setvar "cecolor" "bylayer")
     (setvar "clayer" "0")
     (setvar "celtype" "bylayer")
     (setvar "celweight" -1)
     (setvar "layereval" 1)
     (setvar "layernotify" 0)
     (setvar "textstyle" "standard")
     (command "-dimstyle" "restore" "standard") ;must use "command" because dimstyle system variable is read only.
     (command "-color" "bylayer")
     (command "imageframe" "2")
     (command "-units" "2" "3" "" "" "" "") ;decimal, 3 places, as found, as found, as found, as found.
     (command "zoom" "e")
    ;
     (setq timode(getvar "tilemode"))
     (if(equal timode 0)(command "pspace"))
    ;
    ;
    ;------ CLEAN THE DRAWING ----------
    ;
     (setvar "clayer" "0")
     (command "-scalelistedit" "r" "y" "e")
     (command "audit" "y")
     (command "-purge" "regapps" "*" "no")
     (command "-purge" "all" "*" "no")
    ;
    ;
    (princ)
    )
    ;---------- END ----------

    Is there I can make my enterprise CUI prioritize after the other Partial CUIs?

    thanks for the help!

  2. #2
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2007-07
    Location
    Jo'burg SA
    Posts
    4,344

    Default Re: Enterprise CUI

    Firstly, whenever you use s:startup to define anything to happen at start, use the (defun-q s:startup ...... This ensures that you don't overwrite any other s:startup custom code, it'll "append" your code to any already existing s:startup function.

    As to the rest, you can use the vla functions to unload a menu group - so you can unload any conflicting CUI's. Then to load a CUI as an Enterprise CUI, the only way I know of is to change the Registry value in: HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R17.1\ACAD-6001:409\Profiles\<Each Profile>\General Configuration\EnterpriseMenuFile

    Even the ActiveX stuff doesn't seem to have an EnterpriseCUI in the Preferences->Files collection. Maybe you should rather look at a custom install package. I use AcadInst ... just do a Google on it ... it's free unless you don't want to see any dialogs.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  3. #3
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2007-07
    Location
    Jo'burg SA
    Posts
    4,344

    Default Re: Enterprise CUI

    Scratch that! The Developer Help, just doesn't show any EnterpriseMenuFile in the preferences collection. Try this:
    Code:
    (vl-load-com) ;Ensure the VLisp extensions are loaded
    (setq acad (vlax-get-acad-object)) ;Get the acad application object
    (setq prefs (vla-get-Preferences acad)) ;Get the preferences collection object
    (setq files (vla-get-Files prefs)) ;Get the files collection from preferences object
    (vla-put-EnterpriseMenuFile files "the path to your enterprise CUI") ;Set the enterprise CUI file
    Hope this helps
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  4. #4
    Administrator RobertB's Avatar
    Join Date
    2001-08
    Location
    Dallas TX USA
    Posts
    5,825

    Default Re: Enterprise CUI

    Quote Originally Posted by irneb View Post
    Firstly, whenever you use s:startup to define anything to happen at start, use the (defun-q s:startup ...... This ensures that you don't overwrite any other s:startup custom code, it'll "append" your code to any already existing s:startup function.
    Umm... nope, that alone does not "ensure that you don't overwrite."

    You need to define your own function with defun-q (to make a list-based function) and then append that to any existing S::Startup (which hopefully was also defined using defun-q).

    Example:
    Code:
    (defun-q i:MyStartup () 
     (princ "\nRunning my startup code.") 
     (princ))
    
    (setq S::Startup (append S::Startup i:MyStartup))
    This is a simplistic approach. There are more details under the defun-q-list-set/ref function documentation.
    R. Robert Bell
    Design Technology Manager
    S P A R L I N G
    Opinions expressed are mine alone and do not reflect the views of Sparling.

  5. #5
    Active Member
    Join Date
    2008-08
    Posts
    55

    Default Re: Enterprise CUI

    could one of you guys explain to me what is going on with:
    i:
    s::

    I've never used either of these. Never even seen the i: before. Are there any more special cases besides these 2?

  6. #6
    Administrator RobertB's Avatar
    Join Date
    2001-08
    Location
    Dallas TX USA
    Posts
    5,825

    Post Re: Enterprise CUI

    Quote Originally Posted by howardjosh View Post
    could one of you guys explain to me what is going on with:
    i:
    s::

    I've never used either of these. Never even seen the i: before. Are there any more special cases besides these 2?
    S::Startup is a special function provided by Autodesk that will automatically execute only once the drawing editor is fully loaded.

    Any other prefix, aside from C:, is usable by the programmer. I use "i:" in my online code to indicate an internally defined function. It is just a personal convention to help organize my code and has no other effect.
    R. Robert Bell
    Design Technology Manager
    S P A R L I N G
    Opinions expressed are mine alone and do not reflect the views of Sparling.

  7. #7
    100 Club
    Join Date
    2008-03
    Posts
    156

    Default Re: Enterprise CUI

    Quote Originally Posted by RobertB View Post
    Umm... nope, that alone does not "ensure that you don't overwrite."

    You need to define your own function with defun-q (to make a list-based function) and then append that to any existing S::Startup (which hopefully was also defined using defun-q).

    Example:
    Code:
    (defun-q i:MyStartup () 
     (princ "\nRunning my startup code.") 
     (princ))
     
    (setq S::Startup (append S::Startup i:MyStartup))
    This is a simplistic approach. There are more details under the defun-q-list-set/ref function documentation.
    Robert,

    My apologies, I am unsure how your little bit of code fits into mine?

    It looks like you are defining "mystartup" to be something.
    But I am not sure what.

    And then you set s::startup, which has been appeneded to your internally defined "mystartup", but again, i am unsure where we have defined it.

    thank you
    Last edited by ronsarlo; 2009-05-01 at 09:02 PM. Reason: typo

  8. #8
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    6,836

    Default Re: Enterprise CUI

    He is defining "mystartup" as list with the defun-q function. He is assuming the "S::Startup" function was also defined with the defun-q function and then appending the "mystartup" list to the "S::Startup" list.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  9. #9
    Administrator RobertB's Avatar
    Join Date
    2001-08
    Location
    Dallas TX USA
    Posts
    5,825

    Default Re: Enterprise CUI

    Quote Originally Posted by ronsarlo View Post
    It looks like you are defining "mystartup" to be something.
    But I am not sure what.

    And then you set s::startup, which has been appeneded to your internally defined "mystartup", but again, i am unsure where we have defined it.
    The code you posted is overwriting S::Startup which is bad practice. Move your code over to a function defined using defun-q and then append your function to S::Startup.
    R. Robert Bell
    Design Technology Manager
    S P A R L I N G
    Opinions expressed are mine alone and do not reflect the views of Sparling.

  10. #10
    100 Club
    Join Date
    2008-03
    Posts
    156

    Default Re: Enterprise CUI

    RobertB,

    I am sorry, but it seems I am a bit slow on the uptake.

    I have 2 scenarios which I access via separate profiles.
    scenario a: company software which loads with defun s::startup
    scenario b: client software which also loads with defun s::startup

    I would like my lisp to load and execute after company and client software.


    Can you help me understand what I should be trying to code? and why?


    so sorry

Page 1 of 3 123 LastLast

Similar Threads

  1. Enterprise CUI questions
    By russ.127233 in forum AutoCAD CUI Menus
    Replies: 7
    Last Post: 2010-08-23, 09:39 PM
  2. Enterprise CUI
    By mboyer in forum AutoCAD CUI Menus
    Replies: 2
    Last Post: 2008-09-19, 05:47 PM
  3. Why using the enterprise CUI ...
    By dhurtubise in forum AutoCAD CUI Menus
    Replies: 4
    Last Post: 2005-07-26, 05:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •