PDA

View Full Version : It Sounds Interesting, but It Is Not Working - What Is Wrong?


BoKirra
2007-10-16, 05:49 AM
Hi ALL,

I downloaded a lsp from CADalyst. It doesn't work on my PC.

1) I am in the kindergarten of LSP
2) All program files have been dropped to the search path.
3) The lsp comes with two external files (.cls & .rem). I've checked them & am sure they have no problem.
4) I've also checked the lsp file but found nothing wrong to me - this is the real problem.
5) I am with 2005 mechanical.

Details see the attached files.

Could anyone give a solution?

thanks

Ke

CAB2k
2007-10-16, 02:54 PM
Did you add (Load “date”) (C:remainder) to your acad.lsp file as directed?
Actually I prefer adding it to the acaddoc.lsp file.

RobertB
2007-10-16, 04:13 PM
Did you add (Load “date”) (C:remainder) to your acad.lsp file as directed?
Actually I prefer adding it to the acaddoc.lsp file.The OP is just learning Visual LISP, so perhaps an explaination about the reasons for your preference is in order? ;)

Please see TS21336 (http://usa.autodesk.com/adsk/servlet/ps/item?siteID=123112&id=2897258&linkID=9240617) for details.

There are two files that you may create/edit that load automatically when AutoCAD starts or a drawing is opened. Acad.lsp only runs once, when AutoCAD first starts. AcadDoc.lsp loads every time a drawing is opened. This is the out-of-the-box behavior.

Do not change AcadLspAsDoc=1 simply to load Acad.lsp in every drawing. That limits your options.

dgorsman
2007-10-16, 07:49 PM
Do not change AcadLspAsDoc=1 simply to load Acad.lsp in every drawing. That limits your options.

Quoted for emphasis. The system I am currently working with had that set, and it causes all kind of difficulty trying to properly add things while keeping the entire system up and running.

Needed only once per AutoCAD settings ( (vl-load-com), licence useage logs, etc.) - use acad.lsp
Needed for each drawing (certain system variables, loading common support lisps, automatic drawing tracking, etc.) - use acaddoc.lsp
Needed for a specific user interface (menu pulldown, toolbar, etc.) - use *.mnl that matches with the file the UI is defined in

If the function provided is to be specifically called on demand by the user through a toolbar or menu, I'd put it in the mnl file. That way, if the CUI/MNS is loaded the function will be available. That could also be expanded to disable the calling UI item if the lisp file, or associated data files, are not found - but thats somewhat more advanced.

BoKirra
2007-10-17, 01:00 AM
Did you add (Load “date”) (C:remainder) to your acad.lsp file as directed?
Actually I prefer adding it to the acaddoc.lsp file.

Thanks for everyone's helps.

One thing is confusing me:

I dropped other LSPs to the search path & added them to startup suit then loaded. They work, they work everytime without any problem.

But for this one, I found it doesn't work this way.


Ke

CAB2k
2007-10-17, 01:05 AM
If you type reminder at the command like do you get a message?

CAB2k
2007-10-17, 01:09 AM
Oh shoot, there is a spelling error!:shock:
(Load “date”) (C:remainder)
It should be
(Load “date”) (C:reminder)

BoKirra
2007-10-17, 03:10 AM
If you type reminder at the command like do you get a message?

No, I don't get any messages with the "remainder" command.

CAB2k
2007-10-17, 04:26 AM
No, I don't get any messages with the "remainder" command.

Did you type reminder or remainder?

reminder is the correct spelling.

BoKirra
2007-10-17, 05:52 AM
Did you type reminder or remainder?

reminder is the correct spelling.

Ha,:) I did type reminder, not remainder. It doesn't work at all.

CAB2k
2007-10-17, 01:45 PM
Type the following at the command prompt for debugging this problem:
(findfile "date.lsp")

If not found then it is not in the ACAD path.
If found then enter this:
(load "date.lsp")

if it loaded then there is a problem with your auto load in acaddoc.lsp
if it failed then it may already loaded, so enter this
!c:reminder
you should get something like this:
#<SUBR @03458d20 C:REMINDER>

If it is loaded enter:
reminder

If there is no messages then there are no messages for today.
Add a message for today in the Date.rem file to test it.

BoKirra
2007-10-18, 01:38 AM
Type the following at the command prompt for debugging this problem:
(findfile "date.lsp")

If not found then it is not in the ACAD path.
If found then enter this:
(load "date.lsp")

if it loaded then there is a problem with your auto load in acaddoc.lsp
if it failed then it may already loaded, so enter this
!c:reminder
you should get something like this:
#<SUBR @03458d20 C:REMINDER>

If it is loaded enter:
reminder

If there is no messages then there are no messages for today.
Add a message for today in the Date.rem file to test it.

I added today's event to the second line in Date.rem (as shown below)

09.10.2007 - Project X review
18.10.2007 - ABC
01.11.2007 - Project X finish
13.12.2007 - Vacation start
08.01.2008 - Project Y start date

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Then did the same as you said:

Command: (findfile "date.lsp")
"Q:\\date.lsp"

Command: (load "date.lsp")
C:REMINDER

Command: !c:reminder
#<SUBR @06bbdc30 C:REMINDER>

Command: reminder

Command:

I can't see any messages.:(

CAB2k
2007-10-18, 02:18 AM
Maybe you would like to try my reminder routine?
To use the routine you add a line of code to your acaddoc.lsp file.
(load "Reminder.lsp")(c:Reminder)
This will cause the reminder routine to run each time you open a drawing. A flag will tell the
reminder to pop up only once per day. The message file will allow you to set the number of days
to be reminded before the actual date set. I am considering using a DCL file to allow the user to
dismiss selected reminders so that they go to sleep until the next cycle. At this time if you set
the reminder for 5 days it will pop up every day in the 5 days prior to the due date. My thinking is
that is a task is taken care of you may not want to see the reminder for the remainder of the period.
At this time the messages are displayed in a Alert Box.

Two support lisp's RemOff and RemOn will allow you to force the reminder Off & On.

BoKirra
2007-10-18, 03:54 AM
Maybe you would like to try my reminder routine?
To use the routine you add a line of code to your acaddoc.lsp file.
(load "Reminder.lsp")(c:Reminder)
This will cause the reminder routine to run each time you open a drawing. A flag will tell the
reminder to pop up only once per day. The message file will allow you to set the number of days
to be reminded before the actual date set. I am considering using a DCL file to allow the user to
dismiss selected reminders so that they go to sleep until the next cycle. At this time if you set
the reminder for 5 days it will pop up every day in the 5 days prior to the due date. My thinking is
that is a task is taken care of you may not want to see the reminder for the remainder of the period.
At this time the messages are displayed in a Alert Box.

Two support lisp's RemOff and RemOn will allow you to force the reminder Off & On.

Yes, yours works now & your ideas are a lot better. Thanks.

But I still can't see the problem in date.lsp

CAB2k
2007-10-18, 04:19 AM
Thanks, Glad it worked for you.

If I have some spare time tomorrow I'll look at the problem with date.lsp.

CAB2k
2007-10-22, 11:38 PM
UPDATE

Updated the Reminder lisp to include a dialog box for viewing the reminders. Also by selecting them &
clicking the [Remove] button you will not see them again until next period. Use the Ctrl+Left Click
to select more than one reminder. Added some date error checking.
Messages too long for the dialog box will be wrapped in the list box. If this occurs you may select any
one of the lines of that particular message to dismiss it.

BoKirra
2007-10-23, 05:21 AM
UPDATE

Updated the Reminder lisp to include a dialog box for viewing the reminders. Also by selecting them &
clicking the [Remove] button you will not see them again until next period. Use the Ctrl+Left Click
to select more than one reminder. Added some date error checking.
Messages too long for the dialog box will be wrapped in the list box. If this occurs you may select any
one of the lines of that particular message to dismiss it.

Thanks again.

I will take some time on your routine & learn from it.