Skip to main content
1-Visitor
August 7, 2017
Solved

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

  • August 7, 2017
  • 2 replies
  • 5550 views

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

Best answer by 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

2 replies

15-Moonstone
August 7, 2017

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

 

Madhavi1-VisitorAuthor
1-Visitor
August 8, 2017

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

15-Moonstone
August 8, 2017

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

3-Newcomer
August 23, 2022

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