• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Visual LISP, AutoLISP and General Customization

    Reply
    Active Contributor
    Posts: 30
    Registered: ‎07-25-2008
    Accepted Solution

    Trying to set edittime to on in Acaddoc.lsp

    152 Views, 8 Replies
    03-30-2012 11:27 AM

    Anyone know why I can't do the following in acaddoc.lsp:

     

    (Command "edittime" "ON")

    (Command "edittime "T" "5")

     

    I get this result:

     

    Unknown command "EDITTIME".

     

    It looks like this has to do with the order of operation (i.e. express tools haven't been loaded yet).  If so doesn anyone know how to load the express tools from acaddoc.lsp? 

     

    Thanks!

    _Scott

    Please use plain text.
    Active Contributor
    Posts: 30
    Registered: ‎07-25-2008

    Re: Trying to set edittime to on in Acaddoc.lsp

    03-30-2012 12:18 PM in reply to: scotts

    Update. 


    I changed the acaddoc so that the edittime command is accessed from S::smileyfrustrated:tartup which should occur after express is loaded:

     

    (defun mystartup ()
    (command "EDITTIME" "ON")
    (command "EDITTIME" "T" "1")
    )
    (if s::startup
    (setq s::startup (append s::startup (quote ((mystartup)))))
    (defun s::startup () (mystartup))
    )

     But it still doesn't work.  I noticed if I type edittime at the command line it initializes.  I'm assuming the express commands are demand loaded??? Maybe???  So frustrating because I want to set this to on for every users drawings.   Anyone have any ideas?

     

    Please use plain text.
    Valued Mentor
    gjrcmb
    Posts: 321
    Registered: ‎06-21-2011

    Re: Trying to set edittime to on in Acaddoc.lsp

    03-30-2012 01:28 PM in reply to: scotts

    Not sure about including it within acaddoc.lsp or initializing on startup, but try entering the following in order to initialize Edit Time and turn it on:

    (c:edittime)
    (command "ON")

    instead of the following line:

    (Command "edittime" "ON")

     

    Let me know if that works.

    Gavin Rouleau, PE
    C3D 2012 SP1, Win XP Home
    Please use plain text.
    Active Contributor
    Posts: 30
    Registered: ‎07-25-2008

    Re: Trying to set edittime to on in Acaddoc.lsp

    03-30-2012 01:36 PM in reply to: gjrcmb

    Thanks.  It works.  But why??? 

    Please use plain text.
    *Expert Elite*
    Posts: 836
    Registered: ‎08-16-2007

    Re: Trying to set edittime to on in Acaddoc.lsp

    03-30-2012 01:59 PM in reply to: scotts

    The express tools are either loaded automatically using either autoload or autoarxload.  So if a user issues a command, it is automatically loaded.  If the command is referenced directly with (c:edittime), it seems to be automatically loaded.

     

    You could also explicitly load it and then use command to run it.

     

    (arxload "edittime")

    (command "edittime"....)

     

    You could also call it with

    (command "ACET:EDITTIME.EDITTIME" ....) anytime after loading.

    Please use plain text.
    Valued Mentor
    gjrcmb
    Posts: 321
    Registered: ‎06-21-2011

    Re: Trying to set edittime to on in Acaddoc.lsp

    03-30-2012 02:13 PM in reply to: dbroad

    Glad it worked.  Not sure why really, I just happened to discover it the other day while helping someone else.  It occured to me that a lot of times lisp functions are intiated with c:, so just decided to give c:edittime a try.

     

    So I am glad for the additional info from dbroad.

    Gavin Rouleau, PE
    C3D 2012 SP1, Win XP Home
    Please use plain text.
    Valued Mentor
    gjrcmb
    Posts: 321
    Registered: ‎06-21-2011

    Re: Trying to set edittime to on in Acaddoc.lsp

    03-30-2012 02:28 PM in reply to: gjrcmb

    By the way, there are a couple other postings that relate to this topic which may be of interest:

     

    LISP to Export TIME Command Results to a Text File
    http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/LISP-to-Export-TIME-Command-Results-t...

    how to print last line of command history to a file
    http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/how-to-print-last-line-of-command-his...

    Gavin Rouleau, PE
    C3D 2012 SP1, Win XP Home
    Please use plain text.
    Active Contributor
    Posts: 30
    Registered: ‎07-25-2008

    Re: Trying to set edittime to on in Acaddoc.lsp

    03-30-2012 02:35 PM in reply to: gjrcmb

    Yep I'm tuned into those... In fact I started the second topic you hyperlinked.  Basically what I created is a quick little lisp that runs on drawing open that writes a csv file with the name of the file opened, the time, the total edit time when opened and then does the same thing when the file is closed.  I find it useful for tracking my time.  Lee Mac's code is nice, but I opted for a simpler function or should I say one that I understand since I'm a beginner when it comes to writing lisps.

    Please use plain text.
    Valued Mentor
    gjrcmb
    Posts: 321
    Registered: ‎06-21-2011

    Re: Trying to set edittime to on in Acaddoc.lsp

    03-30-2012 02:39 PM in reply to: scotts

    Ah sorry, didn't make the connection.  Glad I could be of further assistance.  Interesting topic.

    Gavin Rouleau, PE
    C3D 2012 SP1, Win XP Home
    Please use plain text.