cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Creo Toolkit : How to Save .pvz and .png using toolkit.

SOLVED
Garnet

Creo Toolkit : How to Save .pvz and .png using toolkit.

Hello all,

 I am using toolkit (c++) and want to save .pvz and .png of current part/assembly/drawing

with no options selected from Spin Center and Datum display filters.

 

Please let me know if you have any code sample/ function name which can help me.

Warm regards,

Madhavi

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Creo Toolkit : How to Save .pvz and .png using toolkit.

@Eike_Hauptmann

Below is the solution to it Woman Happy

ProConfigoptGet to get the current value ( for example "AXIS_DISPLAY").

if it's 'yes' then set it to 'no' to hide the ConfigOption.

Once desired task is done then it can be re-set to original value!

 

Woman Very Happy

View solution in original post

8 REPLIES 8

Re: Creo Toolkit : How to Save .pvz and .png using toolkit.

AFAIK png isn't supported atm. But could be wrong. JPG would be 

 

JPG:

ProRasterFileWrite(win_id, PRORASTERDEPTH_24, width, height, PRORASTERDPI_600, PRORASTERTYPE_JPEG, ppath);

 

PVZ:

ProProductviewexportoptsAlloc(&opts);
ProProductviewexportoptsFormatSet(opts, PRO_PV_FORMAT_PVZ);
ProProductviewFormattedExport(mdl, ppath, pfile, opts);
ProProductviewexportoptsFree(opts);

 

Br,

Eike

 

Re: Creo Toolkit : How to Save .pvz and .png using toolkit.

Thanks Eric.

I happened to find this solution too and your reply just comfirmed my solution.

Yes png isn't supported so I am using .bmp

But that just solves half of the problem.

I do not want "options selected from Spin Center and Datum display filters."

Do you have any idea how to remove it temporarily (just before exporting .pvz, .bmp) ?

Re: Creo Toolkit : How to Save .pvz and .png using toolkit.

I think datums could be very easy by pushing them to a layer and hide it. (So there are rule based layers and you can do it from a template model by the Toolkit API).

 

Spin center is a little bit more difficult dependend on the Creo Version you're working with. So I know in Creo 4.0 you can use a Macro like : ProMacroLoad("~ Command `ProCmdViewSpinCntr`  0;"); ProMacroExecute(); I think in Creo 2.0 this isn't possible because you didn't get the current status of this button. Creo 3.0 I don't know.

 

Br,

Eike

Re: Creo Toolkit : How to Save .pvz and .png using toolkit.

Luckily I am using Creo 4.0 so I can use Macro.

But facing a problem here.

This works for the first time. Next time it brings the Spin control back.

So basically it toggles the control.

Please take a look at code below and help me find out the problem.

 

ProLine wcmd;
ProStringToWstring(wcmd, "~Command `ProCmdViewSpinCntr` 0");
ProMacroLoad(wcmd);
ProMacroExecute();

 

 

/*
 commands for axis:
~ Command `ProCmdEnvAxisDisp` 0
~ Command `ProCmdEnvPntsDisp` 0
~ Command `ProCmdEnvCsysDisp` 0
~ Command `ProCmdEnvDtmDisp` 0

*/

Re: Creo Toolkit : How to Save .pvz and .png using toolkit.

Oh ... than it's same behaivior as in Creo 2 and 3.0.

 

Sry 4 that.

 

Br,

Eike

Re: Creo Toolkit : How to Save .pvz and .png using toolkit.

ohh okay 😞

 

Thanks for the reply,

Appreciated!

Re: Creo Toolkit : How to Save .pvz and .png using toolkit.

@Eike_Hauptmann

Below is the solution to it Woman Happy

ProConfigoptGet to get the current value ( for example "AXIS_DISPLAY").

if it's 'yes' then set it to 'no' to hide the ConfigOption.

Once desired task is done then it can be re-set to original value!

 

Woman Very Happy

View solution in original post

Re: Creo Toolkit : How to Save .pvz and .png using toolkit.

Thank you : )

Announcements