CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-02-2006, 06:53 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
... GPNTDOCU ... is not of type SEQUENCE

Hi,

I'm writing a Lisp macro that enables people too choose a standard Sketch from a couple of tables, and place it on a drawing. When I start Annotation it works fine, but when I reload the macro, and run it again I get the error:
"LISP error:
#S(GPNTDOCU X 845.7812432206274 Y 87.113589328035232 GPORT "Annotation") is not of type SEQUENCE."
After this, restarting OSD and Annotation is the only way to get it running.
This doesn't give me the feeling that the macro will be stable in "real life"....
The weird thing is that I used the same code for placing a Sketch before, and this macro alway works??!!
I've read somewhere that the in-package and use-package can have something to do with it, but I haven't done anything different here, either...
Attached is the code of my problem-macro.
Thanks in advance!
Regards,
Jaap
Attached Files
File Type: lsp trumpfstempels.lsp (13.3 KB, 424 views)
Reply With Quote
  #2  
Old 01-02-2006, 07:38 AM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
Re: ... GPNTDOCU ... is not of type SEQUENCE

You could probably speed up tracking down the issue by first removing the references to external files and the table definitions from your code; I don't think these are related to the problem.

One thing that I did notice is that you are using a global variable called 'bestand'. Your code assumes that it is of type string. If you happen to load some other code which also uses a variable of the same name (not too unlikely, at least if 'bestand' in Dutch means what I think it means), this could cause an error message like the one you describe.

HTH,
Claus
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/

Last edited by clausb; 01-02-2006 at 08:36 AM.
Reply With Quote
  #3  
Old 01-02-2006, 10:34 PM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: ... GPNTDOCU ... is not of type SEQUENCE

Hi Claus,

thanks for your hints. I changed the name of bestand in something else, but this doesn't do the trick

Do you know if there's a way of getting a list of all variable names that OSD uses at a certain moment??

Thanks,
Regards,
Jaap
Reply With Quote
  #4  
Old 01-02-2006, 10:41 PM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
Re: ... GPNTDOCU ... is not of type SEQUENCE

Lisp has full introspection capabilities, so you could iterate over all symbols in all packages, but this is probably not the quickest way to success.

Instead, I'd recommend to strip down your code to a few lines first, at least far enough so that others can try to reproduce your problem without having to set up the same kind of configuration files which you happen to have on your U: drive.

Also, do you already know exactly in which line you get the error message?

Claus
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/
Reply With Quote
  #5  
Old 01-02-2006, 11:41 PM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
Re: ... GPNTDOCU ... is not of type SEQUENCE

I have now loaded your code into OSDM for several times, without getting any error messages. Also, I have stripped down the dialog to a few lines and used it to place sketches in the drawing for several times, then I reloaded the reduced version of the code. No errors, either.

In your original posting, you write: "When I start Annotation it works fine, but when I reload the macro, and run it again I get the error". I'm wondering what exactly this means. Do you load your code from a customization file, or do you load it interactively?

Claus
Attached Files
File Type: lsp trumpfstempels_reduced.lsp (999 Bytes, 394 views)
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/
Reply With Quote
  #6  
Old 01-03-2006, 12:18 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: ... GPNTDOCU ... is not of type SEQUENCE

Hi,

thanks again! Indeed, the macro stops working as soon as I reload the macro manually. I just did the following:
- I stripped the table stuff from the macro
- loaded the stripped macro - worked fine
- reloaded it - still worked fine
- reloaded the big macro - booom!

Then I restarted OSD/Annotation and did the following:
- loaded the big macro - worked fine
- loaded the stripped macro - booom!

So, something in the table part seems to confuse the gpntdocu as soon as I reload the macro...??!!

Regards,
Jaap
Reply With Quote
  #7  
Old 01-03-2006, 12:48 AM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
Re: ... GPNTDOCU ... is not of type SEQUENCE

So if I understand this correctly, you're not getting any error messages if you load the small version of the code multiple times?

Claus
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/
Reply With Quote
  #8  
Old 01-03-2006, 12:55 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: ... GPNTDOCU ... is not of type SEQUENCE

Hi,

exactly! So, stripping the tables stuff out of the macro cures the problem...
but also makes the macro useless
I just got weird error messages while doing measurements in modeling; I suspect that all kind of things get confused by the macro
I'll try stripping the tables except for one of the "categories" and see if it still goes wrong...

Regards,
Jaap
Reply With Quote
  #9  
Old 01-03-2006, 02:54 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: ... GPNTDOCU ... is not of type SEQUENCE

Hello again,

I pinpointed the cause (not the solution!!) of the problem: as soon as I throw out the selection of the standard Sketch, and simply use a setf instead to choose the right file, everything is completely fine. So, something in this part of the code seems to cause the trouble:
Code:
(rechthoekje :value-type :string
:show-input-tool
(sd-show-display-table "RECHTHOEK"
:position '("CURRENT_WP2-OPTIONS-OPT-CONT-WP-TB"
:leftCenter -10 0))
:hide-input-tool (sd-hide-display-table "RECHTHOEK")
:after-input 
(progn
(setf bestand1 rechthoekje)
 )
)
I left all other code intact, except for the part above and the other, similar, variables (vierkantje, sleufje, etc.).
Can't see the connection to the problem, to be honest
Regards,
Jaap
Reply With Quote
  #10  
Old 01-03-2006, 03:25 AM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
Re: ... GPNTDOCU ... is not of type SEQUENCE

By "selection of the standard sketch", do you mean this line in (doit):

Code:
(setf bestand 
  (format nil "U:/csn/OSD_Modeling_13.20/Symbool/TN/~a.mi" 
	(sd-string-replace bestand "." "_")))
If removing this line from your code "fixes" the error message, I am not really surprised. The error message which you get indicates that you are trying to pass a variable of type gpntdocu to a function which processes Lisp sequences or strings - and the only place in your code with explicit string processing is the call to sd-string-replace.

To test my hypothesis, do the following before executing your test sequence:
  • Open the console window (View/Console)
  • In the user input line, enter (trace oli:sd-string-replace)

Now execute the test sequence and monitor the console window. It should report all calls to sd-string-replace including the passed parameters. Both parameters should always be strings.

Now, if the problem really manifests itself in this line, I still do not understand is how this code could possibly be executed simply by loading the Lisp file. Can you please describe *in detail* what you do to reproduce the issue?

Claus
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/
Reply With Quote
  #11  
Old 01-04-2006, 11:54 PM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: ... GPNTDOCU ... is not of type SEQUENCE

Hi Claus,

thanks again for the tips. This problem is getting quite a learning experience for me
I did the following:
- started Annotation
- started the trace
- loaded the macro; the trace says: sd-defdialog TRUMPFSTEMPELS...
- used the macro to load a "standard Sketch". On pressing the Apply button trace says:
1> (OLI:SD-STRING-REPLACE "TN22510" "." "_")
<1 (OLI:SD-STRING-REPLACE "TN22510")
:GO
:OK
(sounds logical to me!)
- reloaded the macro; trace says: sd-defdialog TRUMPFSTEMPELS...
- used the macro again; as soon as I pick the position, I get the infamous error message, BUT I don't get anything new from the trace window.

By the way, the stripped macro that works does still have the sd-string-replace lines in it. So, apparantly the trouble is somewhere else??!!
Here's what the debugger says when the error occurs:

Error: LISP error:
#S(GPNTDOCU X 1063.60832392254 Y 5.1063204043614414 GPORT "Annotation") is not o
f type SEQUENCE.
Signalled by UPDATE-TOGGLE-DATABacktrace: > evalhook > trumpfstempels > let > m
acrolet > labels > frame2::eval-action-terminateal > frame2::framed-eval-action-
loop > lambda-closure > locally > block > tagbody > let > cond > if > frame2::ha
ndle-transition > frame2::trigger-action-state-transition-event > eventrocess-
event > exec-pers-entry > lambda-closure > pers::trumpfstempels-update-dependent
-variables > let > if > progn > pers::update-variable-ui > update-toggle-data >
display_error

Broken at PERS::UPDATE-VARIABLE-UI.

Doesn't make it very clear to me....
Kind regards,
Jaap
Reply With Quote
  #12  
Old 01-05-2006, 12:04 AM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
Re: ... GPNTDOCU ... is not of type SEQUENCE

OK, so there goes my theory about sd-string-replace. Thanks for the update!

If only I could somehow reproduce the issue. Do you also get this in a "clean" version of OSDM, i.e. without any other customizations loaded? Also, which version of OSDM are you using for your tests?

Claus
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/
Reply With Quote
  #13  
Old 01-05-2006, 01:27 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: ... GPNTDOCU ... is not of type SEQUENCE

Good tip, Claus!
Interesting: when I test it with OSD 12.01, everything is fine. No problems whatsoever. My OSD 12 is set up to load the same macros as our OSD 13.20, except for am_load_plot_table_ex (which is a new OSD 13 command).
So the problem is OSD 13 specific...
I'll try and test it in OSD 13.20 without loading other macros.

Regards,
Jaap
Reply With Quote
  #14  
Old 01-05-2006, 02:33 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: ... GPNTDOCU ... is not of type SEQUENCE

update: just tested the macro with an "empty" OSD/Annotation 13.20 (no other macros loaded), and still got the same error...
So, it's probably not caused by other macros.

Jaap
Reply With Quote
  #15  
Old 01-05-2006, 05:32 AM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
Re: ... GPNTDOCU ... is not of type SEQUENCE

Jaap,

I can now reproduce the problem as well. I'm using the attached reduced version of the original code; to run the code, you need to have a sketch file at c:/temp/foo.mi. Note that this stripped-down version does not even use logical or display tables anymore.

Sequence to reproduce the issue on my system:
  • Run OSDM 2005 + Annotation
  • Create a new drawing
  • Load the macro, run it once to place a sketch
  • Load the macro again, start it and pick a position

I find the behavior quite puzzling. Something in the guts of OSDM starts to choke on this code, but I'm not sure why. It might be worth reporting this as an issue to CoCreate support, in fact.

Can you reproduce the problem on your system using my version of the code?

Claus
Attached Files
File Type: lsp stempels_small.lsp (835 Bytes, 420 views)
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/

Last edited by clausb; 01-05-2006 at 05:49 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:12 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.