Results 1 to 3 of 3

Thread: problem setting profiles via acad.lsp

  1. #1
    Member
    Join Date
    2005-08
    Posts
    13
    Login to Give a bone
    0

    Default problem setting profiles via acad.lsp

    I am a bit of a novice with programming, but have tried to set the profiles for our office using acad.lsp examples from this forum (acad 2009). My adjustments to the paths are below. It all seems to work well except that I get the following error when autocad is launched:
    Command: ; error: Automation Error. Error setting preference property

    Can anyone tell me what this refers to?

    My acad.lsp below:

    (vl-load-com)
    ; This sets a reference to the install path of your product
    (setq acadloc
    (vl-registry-read
    (strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key))
    "ACADLOCATION")
    ); This sets a reference to the files portion of the acad preferences
    (setq *files* (vla-get-files
    (vla-get-preferences (vlax-get-acad-object))
    ))
    ; This builds the string of support file search paths
    (setq sfsp
    (strcat
    "\\\\EVE\\B5\\ACAD_B5;"
    "\\\\EVE\\B5\\ACAD_B5\\LISP;"
    "\\\\EVE\\B5\\ACAD_B5\\ICO;"
    "\\\\EVE\\B5\\ACAD_B5\\PRINTER;"
    (getvar "LOCALROOTPREFIX") "SUPPORT;"
    "C:\\Program Files\\CDG\\CDG Change Case;"
    "\\\\EVE\\B5\\SY;"
    acadloc "\\SUPPORT;"
    acadloc "\\HELP;"
    acadloc "\\FONTS;"
    acadloc "\\EXPRESS;"
    acadloc "\\SUPPORT\\COLOR;"
    )
    )
    ; This actually applies the above string to the current session of AutoCAD.
    ;
    (vla-put-SupportPath *files* sfsp)
    ;
    ; Here are some examples of setting other things
    ;
    (vla-put-TemplateDwgPath *files* "\\\\EVE\\B5\\ACAD_B5\\TEMPLATE")
    (vla-put-PrinterConfigPath *files* "\\\\EVE\\B5\\ACAD_B5\\PRINTER")
    (vla-put-PrinterDescPath *files* "\\\\EVE\\B5\\ACAD_B5\\PRINTER")
    (vla-put-PrinterStyleSheetPath *files* "\\\\EVE\\B5\\ACAD_B5\\PRINTER")
    (vla-put-QnewTemplateFile *files* "\\\\EVE\\B5\\ACAD_B5\\TEMPLATE\\B5.dwt")
    (vla-put-MenuFile *files* "%LocalRootPrefix%\\SUPPORT\\USER.CUI")
    (vla-put-EnterpriseMenuFile *files* "\\\\EVE\\B5\\ACAD_B5\\B5.CUI")
    (vla-put-CustomIconPath *files* "\\\\EVE\\B5\\ACAD_B5\\ICON")
    (vla-put-AltFontFile *files* "\\\\EVE\\B5\\ACAD_B5\\SIMPLEX.SHX")
    ;
    ; Release the object
    (vlax-release-object *files*)
    ;
    ;You should place this in your ACAD.LSP file, not ACAD200x.LSP.

  2. #2
    Member
    Join Date
    2005-08
    Posts
    13
    Login to Give a bone
    0

    Default Re: problem setting profiles via acad.lsp

    On further checking, I have found that the following line is causing the error message:

    (vla-put-MenuFile *files* "%LocalRootPrefix%\\SUPPORT\\USER.CUI")

    When I comment this line out the error message goes away. Another odd thing is that when this line is active, it causes a relaunch of acad to ignore the last workspace setup that was in place when acad closed.

    Isn't the workspace saved in the cui? and why the error message? Any help would be appreciated.

  3. #3
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: problem setting profiles via acad.lsp

    Quote Originally Posted by tbuck View Post
    On further checking, I have found that the following line is causing the error message:

    (vla-put-MenuFile *files* "%LocalRootPrefix%\\SUPPORT\\USER.CUI")

    When I comment this line out the error message goes away. Another odd thing is that when this line is active, it causes a relaunch of acad to ignore the last workspace setup that was in place when acad closed.

    Isn't the workspace saved in the cui? and why the error message? Any help would be appreciated.
    Are you sure the file exists there? I would suggest this code in place of that statement:
    Code:
    (cond ((and (setq cuiFile (findfile "%LocalRootPrefix%\\Support\\User.cui"))
                (/= (strcase (vla-Get-MenuFile *files*)) (strcase cuiFile)))
           (vla-Put-MenuFile *files* cuiFile)
           (command "._Menu" cuiFile)))
    Note that given the use of (command), this function will need to be executed via S::Startup.

    You 2nd issue is because you are blindly overwriting the main "menu" setting every time AutoCAD starts.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

Similar Threads

  1. 2013: ACAD LT '13 Freezing on certain User Profiles, not others
    By benjamin.bourgoin639454 in forum AutoCAD LT - General
    Replies: 1
    Last Post: 2014-07-03, 02:56 PM
  2. export revit topography file to ACAD civil for surface profiles
    By arashdailami329306 in forum AutoCAD Civil 3D - Surfaces
    Replies: 1
    Last Post: 2012-03-06, 04:14 PM
  3. Problem Setting up Acad 2009 Trial Version
    By bennygo in forum AutoCAD General
    Replies: 1
    Last Post: 2008-10-17, 05:08 PM
  4. Control the acad executable and profiles?
    By kewlvigilante in forum AutoCAD Customization
    Replies: 8
    Last Post: 2006-10-10, 07:46 PM

Posting Permissions

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