Start a new topic

powerJobs - Export Images with a specific Resolution

Hello,


is it possible to set a specific Resolution within the Export-Document Commandlet when exporting a file as an Image (.jpg)?


Thank you.




Hello Marcel,

it is not possible to specify a resolution when using the Export-Document commandlet, but you just need a couple of lines of code to export pictures through the Inventor API.

After you opened a file with Open-Document


    $Document = $openResult.Document.Instance

    $height = 4800l

    $width = 4800l

    $view = $Document.Views | Select -First 1

    $view.Fit($true)

    $view.SaveAsBitmap($localJPEGfileLocation, $height, $width)


Depending on the file extension of the first parameter you can export BMP, JPG, PNG, TIFF and GIF with this function.


It is also interesting to note, that the SaveAsBitmap takes a topcolor and a bottomcolor as fourth and fifth parameter, but I can't find what you have to pass into it right now. With those two parameter you can change the background color.



Hello Thomas, 

thank you for your quick response.

I already created my own function to export images with this API Calls. But i think it would be easier to have a build in function in powerJobs.


Thanks a lot.

Login or Signup to post a comment