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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Converting a PVZ file to a PNG

AdamElkins
6-Contributor

Converting a PVZ file to a PNG

How can you convert a PVZ file into a PNG file? Is there an API, or can this be done using something like Publishing Engine which does this as part of the publishing process?

 

Thanks,

Adam

6 REPLIES 6


@AdamElkins wrote:

How can you convert a PVZ file into a PNG file? Is there an API, or can this be done using something like Publishing Engine which does this as part of the publishing process?

 

Thanks,

Adam


Hi,

please provide more details. PVZ is 3D and PNG is bitmap. How do you imagine a conversion?


Martin Hanák

When you publish a dita document to PDF, and other formats, using Arbortext PE, the PVZ files are converted to 2d images, specifically to png. I believe Arbortext PE uses the default view. 

Hi @AdamElkins ,

 

I think we cannot say convert , but more how to print a particular view of a pvz to a picture file ( tiff, bmp, jpg .,..ect)

The principle is the same when you do manually 

You can open the file in  Creo Parametric or Creo view and you can  make a snapshot of the screen area and save it as picture. In Creo Parametric you can print to tiff or jpg.

If you need to do thin manually you need a tool. So I think a good candidate to implement such tool is Creo Parametric Toolkit but also Creo View toolkit but this requires some programming work.

You need to consider what views / orientation you need to print ... etc

Ok , may be , I forgoten one point. 

If this  this pvz files are containing addtional to the 3d geometry  some viewables  and you want to export  the viewables to pictures (jpg, tiff etc)

In this case you can use onnly Creo View Toolkit ( java Toolkit , WebToolkit or WebGL Toolkit) but as mention already it requires some significant invest in programming work and could be done by the PTC consulting team or PTC develpment partners 

May be there are already some tools already develoeped but I myself do not have information about such tool

Yeah, I suspected the Creo View Java toolkit could do it, I can write the code.

you can check the Toolkit User guide chapter "Accessing Viewable Files"

Accessing Viewable Files
All Creo View compatible file types other than .ol files, that is, images,
drawings, documents, and PDF files present in the .pvs or.ed file are called
Creo View viewable files. The methods in this section enable you to access the
viewables in the product structure file.
Methods Introduced:
• ComponentNode.Visit
• ViewableSource.GetName
• ViewableSource.GetDisplayName
• ViewableSource.GetType
The method ComponentNode.Visit visits the viewable sources in the
structure tree. This method takes ViewableSourceVisitor as the input argument.
The following code shows you how to initialize a ViewableSourceVisitor:

//Inherit from the ViewableSourceVisitorEvents class
static class MyViewableSourceVisitorEvents extends
com.ptc.pview.pvkapp.ViewableSourceVisitorEvents
{
public MyViewableSourceVisitorEvents()
{
super();
}
public boolean Visit(com.ptc.pview.pvkapp.ViewableSource
viewableSource)
{
return true;
}
}
//Instantiate a VisitorEvents
MyViewableSourceVisitorEvents vse = new MyViewableSourceVisitorEvents();
ViewableSourceVisitor_impl vsv = new ViewableSourceVisitor_impl();
vsv.SetEventHandler(vse);

ManageObject(vsv);
//Visit every component node in your structure to find
//all the Viewable sources
myComponentNode1.Visit(vsv);
myComponentNode2.Visit(vsv);


The method ViewableSource.GetName returns the name of the specified
viewable file. The name is the actual file name that is used for storing the data.
This could be a temporary file.
The method ViewableSource.GetDisplayName returns the display name
of the specified viewable file. The display name is the name that should be shown
to users.
The method ViewableSource.GetType returns an integer specifying the
type of the viewable file. The type could be a drawing file, document file, image
file, and so on.

===========

This above are the methods in Java Creo View Toolkit which allows to access the viewables /different from .ol (components)  like pdf , pictures ... etc.

I am not quite sure , but I think you can load a viewable to be displayed  inside the visitor event calling the EmbeddedControl.LoadAnnotationSet() and then you can export it to picture using the  APIs:

  • The method ShapeView.SaveImage saves the view to a .bmp file. You can specify the filename, height, width, and resolution of the image file.
  • The method DrawingView.SaveImage saves the view to an image formatfile. You can specify the filename, height, width, and resolution of the image file.
  • The method ImageView.SaveImage saves the view to an image format file.You can specify the filename, height, width, and resolution of the image file.
  • Use the method ShapeInstance.OverrideModelAnnotationColor to change the color of the specified annotation. Specify a new color as one of the input arguments of this method. This method overrides the default color.
  • The method ShapeInstance.IsModelAnnotationColorOverridden determines if the default color of the annotation has been overriden.

 

Top Tags