PowerShape and PowerMill API 2018 compatibility

PowerShape and PowerMill API 2018 compatibility

paolo_lamperti
Autodesk Support Autodesk Support
2,189 Views
9 Replies
Message 1 of 10

PowerShape and PowerMill API 2018 compatibility

paolo_lamperti
Autodesk Support
Autodesk Support

Hi guys ,

I have created a embedded app using PowerShape and PowerMill API .

This app embed Powershape UI in my form .

Now with 2018 versions , PowerShape and PowerMill API starts PS 2018 releases .

 

is there a way to say start only 2017 version of PowerSHAPE ?

 

are PowerShape and PowerMill API fully compatible with 2018 ?

 

thanks

 

regards

 

paolo

 

src=“https://damassets.autodesk.net/content/dam/autodesk/logos/autodesk-logo-primary-rgb-black-small_forum.png” >

Paolo Lamperti , Technical Support Specialist, Advanced Manufacturing WWFO-CSO, Global Product Support

0 Likes
2,190 Views
9 Replies
Replies (9)
Message 2 of 10

luke.edwards.autodesk
Community Manager
Community Manager

You can specify the version to attach to when creating the connection.  The constructor for PSAutomation and PMAutomation both take a version number as a parameter.


Luke Edwards
Consulting Services Manager
0 Likes
Message 3 of 10

paolo_lamperti
Autodesk Support
Autodesk Support

Thanks for the answer

I saw the parameters , but I haven't clear the format of the parameters .

 

They are from Version class , but if I say 

 

// for PMILL 2017 

 Version vs= new Version(21, 0, 30);
 var powermill = new PMAutomation(InstanceReuse.UseExistingInstance, vs);

 

Visual Studio 2015 raise the exception that there is no PowerMILL of such version .

 

please could you give an example on how to set specific version start-up ?

 

thanks

 

regards

 

paolo

src=“https://damassets.autodesk.net/content/dam/autodesk/logos/autodesk-logo-primary-rgb-black-small_forum.png” >

Paolo Lamperti , Technical Support Specialist, Advanced Manufacturing WWFO-CSO, Global Product Support

0 Likes
Message 4 of 10

Anonymous
Not applicable

 

What happens when you type in "PRINT PAR 'version' into PowerMILL 2017?

 

odd, under help>>about my 2017 is version says "21.0.30.64.1203039" but when i type that command into the command window it returns "21.000".

 

With 2018 installed, i can confirm this launches a new session and makes a tool as instructed:

            Version vs = new Version(2018, 0, 0, 1212103);
            PMAutomation powerMILL = new PMAutomation(Autodesk.ProductInterface.InstanceReuse.CreateNewInstance, vs);
            PMProject pmProject = powerMILL.ActiveProject;

            //do stuff with the project
            PMTool newBallnose = pmProject.Tools.CreateBallNosedTool();
            newBallnose.Diameter = 12.7;
            newBallnose.Length = 101.6;

So now we just need to figure out the correct version to use for 2017, assuming all service packs are installed.

 

 

Also, something seems strange with 2017's version number. There are 5 parameters, but i believe there should only be 4: major, minor, build, and revision.

0 Likes
Message 5 of 10

luke.edwards.autodesk
Community Manager
Community Manager

Paolo

 

Please ensure you are running the application in x64 build mode.


Luke Edwards
Consulting Services Manager
Message 6 of 10

Anonymous
Not applicable

Using Luke's suggestion the following should do what you want:

 

            Version vs2017 = Version.Parse("21.0.30");
            PMAutomation powerMILL = new PMAutomation(Autodesk.ProductInterface.InstanceReuse.CreateNewInstance, vs2017, vs2017);
            PMProject pmProject = powerMILL.ActiveProject;
0 Likes
Message 7 of 10

paolo_lamperti
Autodesk Support
Autodesk Support

Hi guys ,

 

I have some issues this time starting PowerSHAPE 2017 , using these lines :

 Version ps2017 = Version.Parse("17.1.36");
 PSAutomation powerSHAPE = new PSAutomation(InstanceReuse.CreateNewInstance, ps2017, ps2017);

 

PowerSHAPE doesn't start correctly

 

please see the attached image from Visual Studio 2015 .

 

do you have any ideas about ?

 

after some time PowerSHAPE starts then closes ...

 

thanks

 

regards

 

paolo

 

src=“https://damassets.autodesk.net/content/dam/autodesk/logos/autodesk-logo-primary-rgb-black-small_forum.png” >

Paolo Lamperti , Technical Support Specialist, Advanced Manufacturing WWFO-CSO, Global Product Support

0 Likes
Message 8 of 10

Anonymous
Not applicable

Is there any more code below that line? Strange that it closes after launching.

 

 

0 Likes
Message 9 of 10

Anonymous
Not applicable

Try version 17.1.45.

 

I just did this to verify the version:

            PSAutomation powerSHAPE = new PSAutomation(Autodesk.ProductInterface.InstanceReuse.UseExistingInstance);
            MessageBox.Show(powerSHAPE.Version.ToString());

It returned 17.1.45. Strange since Help>>About shows 17.1.36.

 

0 Likes
Message 10 of 10

paolo_lamperti
Autodesk Support
Autodesk Support

Hi guys,

yes strange that the version from Help is different from print version in PSHAPE .

I just wrote those two lines of code , as you did .

If you look at the picture attached , something strange happens while the API is searching PSHAPE 2018 probably in the registry .

 

Second problem :

 

powerSHAPE.IsGUIVisible = false;

 

doens't disable the Ribbon upper interface in PSHAPE 2018 ...

 

thanks for your help !!

 

ciao

 

 

paolo

src=“https://damassets.autodesk.net/content/dam/autodesk/logos/autodesk-logo-primary-rgb-black-small_forum.png” >

Paolo Lamperti , Technical Support Specialist, Advanced Manufacturing WWFO-CSO, Global Product Support

0 Likes