Community
PowerShape and PowerMill API Forum
Welcome to Autodesk’s PowerShape and PowerMill API Forums. Share your knowledge, ask questions, and explore popular API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API Boot Speed

6 REPLIES 6
Reply
Message 1 of 7
barr.jarryd
386 Views, 6 Replies

API Boot Speed

Hey all,

 

Just a quick inquiry, but does anyone have an issue with boot time on standalone API's?

When opening the API it seems to be parsing through everything in a session, and with larger sessions it seems to take forever to get through all that information.

 

Is there a way that I could perhaps tell the API to stop parsing through all that information and just look for what it needs when I tell it to?

Thanks in advance.

6 REPLIES 6
Message 2 of 7
icse
in reply to: barr.jarryd

This would be a really nice feature... with large projects the connection can take a while

Message 3 of 7

Hi, are you guys talking about PowerMill or PowerShape or both? What kind of times are you seeing? If you want to DM me a project to test with then feel free.

Luke


Luke Edwards
Consulting Services Manager
Message 4 of 7

Did not used the api in a while...

 

The moment you create a new session the api gets information about all toolpaths, tools etc.

This can take a significant longer with larger projects ~500+ entities.

 

var pm = new PMAutomation(Autodesk.ProductInterface.InstanceReuse.UseExistingInstance);
var session = pm.ActiveProject;

 

 

Message 5 of 7

In my automation framework (different from Autodesk) I have run into the same issue and my conclusion is that there is a really significant bottleneck between Powermill and an API applications.

When you have a big project you need to extract the values in bundles instead of one by one. For example if you want to initialize a list of toolpaths with its strategy types. Then there is huge difference when it's calling by print strategy to each one separately or when it is used by:

print par "$extract($folder('toolpath'),'name')"
print par "$extract($folder('toolpath'),'strategy')" 


In that case only 2 calls to Powermill are performed and it is instantaneous even with projects with hundreds of entities. But the extract approach has its own pitfalls. 

 

Personally in the past I had some free time some time ago and tried to rewrite the Autodesk API to this approach. It is publicly forked on GitHub. But it is spaghetti and maybe not so stable, because the extract commands could sometimes fail.

 

I am using the extract approach extensively, but in my custom framework.

Message 6 of 7

I haven't tried it with PowerShape as I don't use it to often. I find that with any session, if it has a lot of entities it can take up to 30sec to a Minute to connect to that session. Any session with over 500 entities should be a good starting point.

Message 7 of 7

Yeah I'm currently working on rewriting the DLL for Product Interface to eliminate the need to parse through the entire project. To me it seems like that step is unnecessary until you actually need to refresh the session. I am also trying to rebuild the Refresh() method to allow arguments so that you can control what you refresh instead of refreshing the whole session at once.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums