Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Mentor
mdhutchinson
Posts: 2,322
Registered: ‎11-18-2003
Message 1 of 8 (2,782 Views)
Accepted Solution

LIST command output to a file?

2782 Views, 7 Replies
12-15-2011 05:41 AM

The LIST command prints to the text screen.... when there is more than one screen, AutoCAD prompts: "Press ENTER to continue:"

 

I tried a cmdactive loop list this

 

(while (eq 1 (logand 1 (getvar "cmdactive")))
    (command "")
)

 

But it doesn't work in this case.

 

I thought there was a variable to control how many line of text goes to the textscreen but I can't seem to find it.

 

Any ideas how I can do this programmatically?

QAFLAGS 2

 

Valued Mentor
gjrcmb
Posts: 326
Registered: ‎06-21-2011
Message 2 of 8 (2,768 Views)

Re: LIST command output to a file?

12-15-2011 09:50 AM in reply to: mdhutchinson

As far as how to control the length of the Text Screen, I copied the following from somewhere:

 

Command: (setenv "CmdHistLines" "1000")
In this example, I'm setting the history length to 1000 lines. The allowable range is between 25 lines and 2048 lines. If you try to set a value outside that range, it will default to the last used length. This new value gets saved to the current profile.
If you want to find out the current history length, you can type the following:  Command: (getenv "CmdHistLines")
"1000".  Note that "CmdHistLines" is case-sensitive and must be entered that way. Also, the length value must be included within quotes as shown. 

Valued Mentor
mdhutchinson
Posts: 2,322
Registered: ‎11-18-2003
Message 3 of 8 (2,762 Views)

Re: LIST command output to a file?

12-15-2011 10:05 AM in reply to: gjrcmb

Thanks!

I was in hopes that this would suppress the "Press ENTER to continue:"

 

But alas it does not.

 

Might there be a way I can pass a script to the LIST that would issue the correct number of <enter> keys?   I wonder? 

 

Active Member
StephenCollier
Posts: 9
Registered: ‎11-13-2006
Message 4 of 8 (2,748 Views)

Re: LIST command output to a file?

12-15-2011 03:40 PM in reply to: mdhutchinson

Hmmmm... the help says "You can use LIST to display and then copy the properties of selected objects to a text file."  I can't find any options to do that though.  I guess they mean you can manually do that.  I tried setting EXPERT to 1 as a long shot, but no go.  The only thing I can think of to suggest is to write the equivalent routine so you can totally control it... Might take a bit of time, but the code might be useful in future projects.

Valued Mentor
mdhutchinson
Posts: 2,322
Registered: ‎11-18-2003
Message 5 of 8 (2,742 Views)

Re: LIST command output to a file?

12-15-2011 06:27 PM in reply to: mdhutchinson

The option to get the text screen to a file is LOGFILEON... I ended up LISTing one object at a time. This then doesn't require the EnterKey from the user. Takes a bit longer, but it accomplished what I needed. 

 

Woud still like to LIST all he objects together then get the text file... but I can't find the solution to get the Enter Key in Lisp to act in the midst of the LIST command output.

 

The info I need using the LIST comman is because I cannot find another way.  This is AutoCAD MEP and Autodesk took away all but the essential DXF data...  

 

There might be a way to use a Script to do this EnterKey.. but I have not tried this yet.

*Expert Elite*
pbejse
Posts: 2,515
Registered: ‎11-24-2009
Message 6 of 8 (2,736 Views)

Re: LIST command output to a file?

12-15-2011 08:14 PM in reply to: mdhutchinson

QAFLAGS 2

 

Valued Mentor
mdhutchinson
Posts: 2,322
Registered: ‎11-18-2003
Message 7 of 8 (2,730 Views)

Re: LIST command output to a file?

12-15-2011 09:04 PM in reply to: pbejse

Thank you!!!

I will test and come back to 'accept as an solution"

 

yes it works!!!

 

I didn't thing to look at undocumented commands.

 

... but why would they take this out?

*Expert Elite*
pbejse
Posts: 2,515
Registered: ‎11-24-2009
Message 8 of 8 (2,724 Views)

Re: LIST command output to a file?

12-15-2011 09:28 PM in reply to: mdhutchinson

mdhutchinson wrote:

Thank you!!!

I will test and come back 'accept as an solution"


Glad I could help mdhutchinson

 

Cheers :smileyhappy:

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.