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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

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

Madhavi
12-Amethyst

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

ACCEPTED SOLUTION

Accepted Solutions
Madhavi
12-Amethyst
(To:Madhavi)

@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

9 REPLIES 9

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

 

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) ?

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

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

*/

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

 

Sry 4 that.

 

Br,

Eike

ohh okay 😞

 

Thanks for the reply,

Appreciated!

Madhavi
12-Amethyst
(To:Madhavi)

@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

Thank you : )

HI Madhavi,

 

I am not able to understand the code you are trying to use for the task. can you please the code from starting , it will be help full for me a lot.

 

 

Thanks inAdvance

Abdul

Announcements


Top Tags