Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Contributor
scotts
Posts: 30
Registered: ‎07-25-2008
Message 1 of 9 (229 Views)
Accepted Solution

Trying to set edittime to on in Acaddoc.lsp

229 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

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.

Active Contributor
scotts
Posts: 30
Registered: ‎07-25-2008
Message 2 of 9 (225 Views)

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?

 

Valued Mentor
gjrcmb
Posts: 326
Registered: ‎06-21-2011
Message 3 of 9 (216 Views)

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.

Active Contributor
scotts
Posts: 30
Registered: ‎07-25-2008
Message 4 of 9 (214 Views)

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??? 

*Expert Elite*
dbroad
Posts: 1,648
Registered: ‎08-16-2007
Message 5 of 9 (210 Views)

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.

Valued Mentor
gjrcmb
Posts: 326
Registered: ‎06-21-2011
Message 6 of 9 (207 Views)

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.

Valued Mentor
gjrcmb
Posts: 326
Registered: ‎06-21-2011
Message 7 of 9 (202 Views)

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...

Active Contributor
scotts
Posts: 30
Registered: ‎07-25-2008
Message 8 of 9 (199 Views)

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.

Valued Mentor
gjrcmb
Posts: 326
Registered: ‎06-21-2011
Message 9 of 9 (195 Views)

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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.