CoCreate User Forum

CoCreate User Forum (https://www.cocreateusers.org/forum/index.php)
-   Customization (https://www.cocreateusers.org/forum/forumdisplay.php?f=12)
-   -   Suppress Error Messages??? (https://www.cocreateusers.org/forum/showthread.php?t=8167)

jkramer 09-25-2014 12:27 AM

Suppress Error Messages???
 
Hi,

we are trying to build a kind of CAD worker that loads an Annotation Drawing and it's owning 3D Model from Workgroup Manager, then updates the text references in the drawing (that's where we need the model for), and then creates a pdf. We can do all actions except the loading of the drawing. We use the command
Code:

(sd-uwgm-element-load "A0046550.mi")
There is a bug in the Workgroup manager: in the Console we see that it uses
Code:

(oli::sd-call-cmds(AM_LOAD_DRAWING :FILENAME "g:/.wgm/.ws/ourwindchillservername/Parts/myannotationdrawing.mi"))
This gives an error "Illegal call to action routine". Probably the sd-call-cmds that they use shouldn't be there, because I get the same error if I manually type in the command, and without sd-call-cmds I get my drawing.
My question: is there a Lisp trick to press the OK button of the error message, or prevent the error message from getting in the way?? That way, we can go on with our Lisp macro...
The reason: although the command fails, at least it gets the drawing from Windchill to the workspace, so we can get it from there afterwards with AM_LOAD_DRAWING, that is, if we could get rid of the error message...
The weird (good) thing is that a 3D model loads nicely with
Code:

(sd-uwgm-element-load "A0046550.sdpc")
We also found a bug report on ptc.com that bundle files also fail... not good!
Thanks for any suggestion!
Jaap

jkramer 09-25-2014 07:51 AM

Re: Suppress Error Messages???
 
Good news, problem solved. By putting the command in a function it suddenly worked. Something like:
Code:

(defun loadfromwgm (elementname)
(sd-uwgm-element-load elementname)
)

(loadfromwgm "A0046550.mi")

Still weird...

rvn 05-31-2016 12:26 PM

Re: Suppress Error Messages???
 
Hi Jaap,

I'm trying to do something simular, and I also get the same error "Illegal call to action routine". I also tried your alternative, but I get the same error again. Did you found some other way to solve this problem, or somebody else?
This error indeed only comes with mi-files and not with sdac or sdpc files.

Thanks in advance

jkramer 06-01-2016 04:56 AM

Re: Suppress Error Messages???
 
Sorry, no. I do know that wherever possible sd-call-cmds should be used, but this can only be done from within functions / sd-defdialog. So, when typing stuff in the command line, it won't work. Nice thing about sd-call-cmds is that the :failure and :success options often work :-)

rvn 11-08-2016 10:45 AM

Re: Suppress Error Messages???
 
I retried this today and found a working solution for me.

make a lisp file with only this code in it.

Code:

(progn
(sd-uwgm-element-load (sd-uwgm-element-exists "number.mi"))
)

Do not put anything else in it and open the lisp file in Modeling. Then it works fine. Very strange.
Do not put this between other code or it will not work.


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

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