Site Logo
Site Logo
 
It is currently Sun Apr 02, 2017 7:02 pm

All times are UTC [ DST ]




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Switching models and reattaching to current model
PostPosted: Thu Feb 04, 2016 2:32 pm 
Offline
DELCAM User
DELCAM User

Joined: Tue Feb 17, 2015 7:15 pm
Posts: 29
Hello,

Im having some issues when I have switched to another model or window when I have executed the "useexistinginstance" command in the previous one.

"Dim PowerSHAPE As New PSAutomation(Delcam.ProductInterface.InstanceReuse.UseExistingInstance)"

Executing this command in multiple models and then trying to switch between them brings up this error:

"The last operation caused an internal error in Delcam PowerSHAPE-e"

Description on PSAutomation says that if the current PSAutomation class is replaced the current is destroyed. Does this affect inside powerSHAPE?


Top
 Profile  
 
 Post subject: Re: Switching models and reattaching to current model
PostPosted: Thu Feb 04, 2016 3:04 pm 
Offline
DELCAM Staff
DELCAM Staff

Joined: Tue Mar 17, 2009 2:30 pm
Posts: 108
Hi Erik

Do you mean you are trying to connect to a second instance of PowerSHAPE? Or are you trying to use a different model within PowerSHAPE?

For the latter you can use:
_powerSHAPE.Models <- This gives you access to all the models and the ability to open a new one and work with that
_powerSHAPE.Windows <- This gives you access to all the windows in PowerSHAPE

Be aware that you can only ever work with the active model. So if you have multiple models open at one time, you need to make sure the one you are trying to interact with is the active model.


Top
 Profile  
 
 Post subject: Re: Switching models and reattaching to current model
PostPosted: Thu Mar 31, 2016 1:26 pm 
Offline
DELCAM User
DELCAM User

Joined: Tue Feb 17, 2015 7:15 pm
Posts: 29
Hello Luke,

The problem seems to be with terminating/finalizing PSautomation class variable. If I declare the PSAutomation class variable as local inside Sub it goes out of scope when Sub ends and there is no problem. Ofcourse here there is no manual interaction with PowerSHAPE while PSAutomation class variable exists, since it goes out of scope after Sub is completed. If I declare the PSAutomation class variable as global it exists as long as the program is running or when its declared again.

While PSAutomation class variable is declared and connection to PowerSHAPE thus exists, interacting with UI inside PowerSHAPE manually creates this problem. Could this problem be solved if PsAutomation was terminated before interacting with PowerSHAPE manually or is there a bug with Powershape? How do you finalize/terminate the PSAutomation class variable? I tried to use powershape.dispose() and setting PowerSHAPE = nothing, but its not helping.

Erik


Top
 Profile  
 
 Post subject: Re: Switching models and reattaching to current model
PostPosted: Wed Jun 15, 2016 1:52 pm 
Offline
DELCAM Staff
DELCAM Staff

Joined: Tue Mar 17, 2009 2:30 pm
Posts: 108
Hi Erik

Sorry, I am not understanding your problem. Can you provide a short example of what is happening?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB