PDA

View Full Version : Unexpected end


Rara
04-10-2005, 06:37 AM
I have two questions:

1) I want to use a lisp routine (bom.lsp) to attach attributes to parts and assembly´s but I get the following error:

LISP error:
Unexpected end of #<input stream "bom.lsp">.

What causes this error?

2)Is it somehow possible to use an excel sheet instead of the logical table?

dorothea
04-10-2005, 10:37 PM
Hi Rara,

Just append a line break after ' );;sd-defdialog'
Then the file is loading.

Dorothea

Rara
04-11-2005, 12:43 AM
Hi Rara,

Just append a line break after ' );;sd-defdialog'
Then the file is loading.

Dorothea
Thank you very much dorothea. The file is indeed loading but unfortunatly the "Apply" button doesn't work :confused:...any suggestions? Also unfortunalty my knowledge of lisp is very poor. :o

clausb
04-11-2005, 02:09 AM
It would be helpful if you could specify a little more in detail what you mean by "it doesn't work" .-) What it is supposed to do? How do you know that "it doesn't work"? Do you get error messages? How do you test? Etc etc.

I didn't run your code, but from looking at it, it strikes me that the "Apply" button in your code calls sd-call-cmds to run an ordinary LISP function (l-articleno-action). This is unnecessary.

Claus

Rara
04-11-2005, 02:43 AM
It would be helpful if you could specify a little more in detail what you mean by "it doesn't work" .-) What it is supposed to do? How do you know that "it doesn't work"? Do you get error messages? How do you test? Etc etc.

I didn't run your code, but from looking at it, it strikes me that the "Apply" button in your code calls sd-call-cmds to run an ordinary LISP function (l-articleno-action). This is unnecessary.

ClausSorry for my lack of information. The apply function should attach some attributes to parts and assembly's. I know that it doesn't work because when I check the part there are no attributes attached to it. When I use the "ok" button the attributes do get attached. I don't get an error. I want to create an apply (or next) button so I don't have to restart the routine everytime I want to define attributes to a following part.

Wolfgang
04-11-2005, 10:41 AM
Here's the corrected part of your dialog (remove the blank after all the ':'):

(AKTIEKNOP
: title "Apply"
: toggle-type :wide-toggle
: push-action (l-articleno-action)
);;AKTIEKNOP
);;variables

:local-functions '(
(l-articleno-action ()
(progn
(sd-attach-item-attribute object "MY_SPECIAL_BOM_ATTR"
: attachment : contents
: on-copy : copy
: on-merge : maintain
: on-split : copy
: on-xform : maintain
: filing '(: sd-file)
: values (list
: articleno articleno
: name name
: dimension dimension
: material material
: note note
)
)
)
);;l-article-action
);;local-functions

So mainly it was the local function.
the sd-call-cmds is not needed (as Claus already mentioned), sd-call-cmds is only needed when you are calling annother action/dialog
there was a quote at the beginning of l-articleno-action -> wrong, you only need the quote when starting the list of local functions
TIP avoid quotes when not really needed, see the :values list. It's easier to read and write to use "(list" here instead of using backqoute + comma.
the line end at last line of lisp file (as Dorothea already mentioned)

How to test: well I traced what you want to do
(trace oli::sd-attach-item-attribute) and saw that it was not called at all.

TIP: may be you would like to add the line ":auto-add-proposal T" to your input variables?
TIP and ... ":persistent-proposals T" to the dialog..

Rara
04-11-2005, 10:46 PM
Thank you very much Wolfgang, also for the tips however I have to do some research to find out what they mean (":auto-add-proposal T" and ":persistent-proposals T") because of my limited knowledge of lisp.

Wolfgang
04-12-2005, 12:27 PM
:) :)

> ":auto-add-proposal T" and ":persistent-proposals T"
both are explained in defdialog manual, just the normal IKIT documentation.

You can add them nearly 'blind' for string and number variables. This makes usage of the dialogs easier.

@all
Yes there's also the 'last values' possibility in right mouse click on the input field.. I like the proposals more...