CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-28-2016, 07:58 PM
kting kting is offline
Registered User
 
Join Date: Nov 2008
Posts: 17
Question sd-return-to-model-checkpoint function

Hi~

I had programed one add-on apllication and used sd-set-model-checkpoint and sd-return-to-model-checkpoint functions to do return to the initial model state.When I to do that several time,the dialog pushing OK or CANCEL buttons did not to terminate the dialog and Modeling gave a Error message as below.Could anybody tell me why?
Click image for larger version

Name:	11.JPG
Views:	390
Size:	9.1 KB
ID:	1943
__________________
Best regards,
Kting
Reply With Quote
  #2  
Old 12-02-2016, 01:47 PM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
Re: sd-return-to-model-checkpoint function

Hi kting,

How are you using it? I don't think I've seen that error message before, but I've seen similar messages when trying to return to a state that no longer exists. Perhaps with a little more detail we can solve it for you.

Thanks!

andy
__________________
Andy Poulsen
AI MAXTools: Dream. Design. Done. It's that easy!
Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+!
See them in action at www.ai-maxtools.com and then try them for yourself -- FREE!
Reply With Quote
  #3  
Old 12-04-2016, 04:05 PM
kting kting is offline
Registered User
 
Join Date: Nov 2008
Posts: 17
Re: sd-return-to-model-checkpoint function

Andy,

I tried to simplify the program code and found that would not appear the error again.See the attachmenttest11.lsp.
In the simplified code it only had to do command position_pa to translate one fixed length alone one direction.And in the old code it had to do command position_pa to translate and rotate and then to do subtract.
Maybe it's interrupted between the commands. I could not sure about that.
__________________
Best regards,
Kting
Reply With Quote
  #4  
Old 12-05-2016, 05:43 PM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
Re: sd-return-to-model-checkpoint function

Thanks for the additional information.

I'm not totally sure why it would be giving you the error. However, one thing that I noticed that's different from the way I usually do things is that you're using sd-call-cmds to call your own function that then calls the Modeling commands.

The way I'd usually do that is in the push-action for doit_p, just call test_process, and then in the test_process function do something like this
Code:
(test_process ()
  (sd-call-cmds (position_pa ...  ))
  (sd-call-cmds (position_pa ...  ))
  (sd-call-cmds (other_modeling_function ....))
  )
This allows you to check the status at each step of the process to make sure you got the result you were expecting (and I believe it's more the way sd-call-cmds was intended to be used).

Also, I don't believe you need to include the :done in your position_pa function. Even though I don't believe it will cause an error, I don't think it does anything, either.

I hope this helps -- please let me know if you have more questions.

Thanks!

andy
__________________
Andy Poulsen
AI MAXTools: Dream. Design. Done. It's that easy!
Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+!
See them in action at www.ai-maxtools.com and then try them for yourself -- FREE!
Reply With Quote
  #5  
Old 12-11-2016, 03:52 PM
kting kting is offline
Registered User
 
Join Date: Nov 2008
Posts: 17
Re: sd-return-to-model-checkpoint function

Andy,

I tried to change the code as your suggestion to use sd-call-cmds in the test_process function and do not include the :done in the position_pa function.
Yes, the code was still work.
When I go to do that several time again,the dialog pushing OK or CANCEL buttons still did not to terminate the dialog and Modeling gave other Error message as below.
Click image for larger version

Name:	12.JPG
Views:	333
Size:	9.3 KB
ID:	1949
__________________
Best regards,
Kting
Reply With Quote
  #6  
Old 12-12-2016, 09:11 AM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
Re: sd-return-to-model-checkpoint function

Interesting.

What do you have in ok-action and cancel-action? I wonder if something there is causing the error. Where do you set the initial state that you're trying to return to? That could be a potential cause of the problem as well.
__________________
Andy Poulsen
AI MAXTools: Dream. Design. Done. It's that easy!
Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+!
See them in action at www.ai-maxtools.com and then try them for yourself -- FREE!
Reply With Quote
  #7  
Old 12-14-2016, 06:15 PM
kting kting is offline
Registered User
 
Join Date: Nov 2008
Posts: 17
Re: sd-return-to-model-checkpoint function

The prolem is solved by Andy's warm-hearted help.
And the cause is not right way to use sd-set-model-checkpoint and sd-return-to-model-checkpoint functions in the code.
__________________
Best regards,
Kting
Reply With Quote
  #8  
Old 12-19-2016, 04:00 AM
tom kirkman's Avatar
tom kirkman tom kirkman is offline
Registered User
 
Join Date: Oct 2002
Location: Perrysburg, Ohio
Posts: 397
Re: sd-return-to-model-checkpoint function

Can you share the code? I would like to learn from what you did.

Thanks

Tom
__________________
Tom Kirkman

Creo Elements/Direct 20.1
Dell Precision 3581
https://www.o-i.com
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 10:15 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.