Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: STARTUP SUITE PROBLEMS

  1. #1
    Active Member
    Join Date
    2013-03
    Location
    Permian Basin
    Posts
    76
    Login to Give a bone
    0

    Default STARTUP SUITE PROBLEMS

    I have a routine that will copy the .dwg file name and put it into my title block under the title. It works perfectly except I can't get it to load into my startup suite. If I want the code to run I have to manually load it each time I want to use it. My company protects the acadloc.lsp file so I cant load it into there. Is there a way I can manipulate the code to make it run under the startup suite?

    Code:
    (defun c:cdn ()
    (setq name (getvar "dwgname"))
    (setq nm1 (substr name 1 (-(strlen name)4) ))
    (defun Glblattchg (bn Tg Tv / aDoc ss)
      (vl-load-com)
      (setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
      (cond
        ((and
           (ssget
             "_x"
             (list '(0 . "INSERT") (cons 2 (strcat bn ",`*U*")))
             )
           (vlax-for
              itm (setq ss (vla-get-ActiveSelectionSet aDoc))
             (if (and
                   (eq (strcase (vla-get-EffectiveName itm)) (strcase bn))
                   (setq itm (assoc
                     (strcase tg)
                     (mapcar
                       (function
                         (lambda (j)
                           (list
                             (vla-get-tagstring j)
                             (vla-get-textstring j)
                             j
                             )
                           )
                         )
                       (vlax-invoke itm 'GetAttributes)
                       )
                     )
                     )
                   )(vla-put-textstring (last itm) tv)
               
               )
             )
           (vla-delete ss)
           )
         )
        )
      )
    (GLBLATTCHG "2012-BORDER" "DWG_NAME" nm1)
    (princ)
    )

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,505
    Login to Give a bone
    0

    Default Re: STARTUP SUITE PROBLEMS

    Consider using Acaddoc.lsp for loading lisp routines (as well as variables etc), way better than startup suite!!
    Seach AUGI for this topic, I'm sure this will fix your problem.

    ** edit **
    sorry, just read where your acaddoc.lsp is protected.. my bad

  3. #3
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,505
    Login to Give a bone
    0

    Default Re: STARTUP SUITE PROBLEMS

    Ok, another question, why don't you use a field to automatically place the file name in the title block?
    You wouldn't need the routine at all (as far as I can tell)
    Just curious

  4. #4
    Active Member
    Join Date
    2013-03
    Location
    Permian Basin
    Posts
    76
    Login to Give a bone
    0

    Default Re: STARTUP SUITE PROBLEMS

    I would like to use fields but the client stated that they want no fields in their drawings.

  5. #5
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: STARTUP SUITE PROBLEMS

    A couple of things....

    I do not use Startup Suite at all, but try adding this to the very bottom of your routine:

    Code:
    (c:cdn)
    ... You see the code you posted above defines the command, but never calls (invokes) it. Adding this ^^ to the end of the code will do exactly that; call the command each time the routine (the source .lsp file) is loaded.



    Quote Originally Posted by jayhay35365091 View Post
    My company protects the acadloc.lsp file so I cant load it into there. Is there a way I can manipulate the code to make it run under the startup suite?
    There's nothing wrong with AcadDoc.lsp being read-only, I did that for years, but I also had the forethought that other users would like to load their own LISP which is why I added something like this:

    Quote Originally Posted by BlackBox View Post
    I also add (load <username>.lsp) functionality with which each user can specify their own variable settings, customizations, etc.. This file is saved in the user's personal network space, which is also included in the Support File Search Paths.

    Example:
    Code:
    (if (findfile (strcat (setq userName (getvar 'loginname)) ".lsp"))
       (load userName)
    )


    As for modifying the title block, why not just populate that attribute via Field & Sheet Set Manager? All OOTB functionality.

    [Edit] - Just saw your post about client relegation with regard to field use.

    HTH
    Last edited by BlackBox; 2014-02-28 at 08:12 PM.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  6. #6
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: STARTUP SUITE PROBLEMS

    Some of our clients are running EDMS systems which include DWG viewers which can't process fields. It happens, we just have to live with it and move on.

  7. #7
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: STARTUP SUITE PROBLEMS

    Quote Originally Posted by dgorsman View Post
    Some of our clients are running EDMS systems which include DWG viewers which can't process fields. It happens, we just have to live with it and move on.
    No worries; makes sense... I may have been a bit harsh.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  8. #8
    Member
    Join Date
    2016-01
    Posts
    4
    Login to Give a bone
    0

    Default Re: STARTUP SUITE PROBLEMS

    These are just some ideas in case they haven't been considered. They may or may not help... it depends on how your company operates.

    Quote Originally Posted by dgorsman View Post
    Some of our clients are running EDMS systems which include DWG viewers which can't process fields.
    From this I assume that using RTEXT in the Title Block with a DIESEL expression isn't acceptable either? It's a simple way to achieve the same thing.
    Code:
    $(substr,$(getvar,dwgname),1,$(-,$(strlen,$(getvar,dwgname)),4))
    If both your main and enterprise customisation files are not read only, can you add your own "partial customisation file" without changing company setup? Look into what can be done with the "LISP Files" node in the CUI or with ".mnl" files.

    Appload data is stored in your pc's registry. Perhaps the reason it isn't working for you is user account control imposed by your IT department? There are various ways that CAD and IT management can balance enforcing company standards while allowing individual preferences. BlackBox's suggestion in post #5 is a good example. Individual preferences can enhance productivity. Perhaps internal discussions with the management can lead to some aspects being relaxed?

  9. #9
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: STARTUP SUITE PROBLEMS

    The last alternative that I can come up with, for a user to circumvent any read-only permissions to the built-in files, etc. (in 2012+ versions) is to use the Autoloader mechanism, which is local to user and is implicitly trusted... Autoloader supports LISP, and setting the PerDocument XmlAttribute to "true" will allow any custom LISP routine(s) to be loaded automagically into all documents opened in the editor (similar to AcadDoc.lsp).

    HTH
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  10. #10
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,505
    Login to Give a bone
    0

    Default Re: STARTUP SUITE PROBLEMS

    Quote Originally Posted by BlackBox View Post
    A couple of things....

    I do not use Startup Suite at all, but try adding this to the very bottom of your routine:

    Code:
    (c:cdn)
    ... You see the code you posted above defines the command, but never calls (invokes) it. Adding this ^^ to the end of the code will do exactly that; call the command each time the routine (the source .lsp file) is loaded.


    There's nothing wrong with AcadDoc.lsp being read-only, I did that for years, but I also had the forethought that other users would like to load their own LISP which is why I added something like this:
    Both great suggestions!
    Thanks BlackBox, I learned something new today (your second suggestion).. never thought of that before.

    @Jayhay....
    I'm thinking BB's first suggestion will be the quickest and should work for you.
    The second one would require your administrator adding that code to the protected acaddoc.lsp where anyone with a <loginname>.lsp could run their own routines too on thier acad sessions.

    Let us know how it works out for you.

Page 1 of 2 12 LastLast

Similar Threads

  1. Startup Suite
    By Borgster in forum AutoLISP
    Replies: 2
    Last Post: 2014-04-24, 04:31 PM
  2. Startup Suite Not Working
    By jchavez76 in forum AutoCAD Customization
    Replies: 4
    Last Post: 2010-10-08, 12:09 PM
  3. VBA and Startup Suite
    By mboyer in forum VBA/COM Interop
    Replies: 10
    Last Post: 2007-01-16, 09:26 PM
  4. Startup Suite
    By dmarcotte4 in forum API Wish List
    Replies: 0
    Last Post: 2006-11-02, 04:19 AM
  5. Startup Suite and Profiles
    By mjsregister in forum VBA/COM Interop
    Replies: 2
    Last Post: 2004-06-28, 12:06 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
  •