Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Render with the API?

0 REPLIES 0
Reply
Message 1 of 1
nannerdw
378 Views, 0 Replies

Render with the API?

I am trying to use this transient camera function in Inventor 2012, but I want to replace SaveAsBitmap with a line to render the image and output to a file instead. Is this possible?

 

Private Function GetImage(ByVal Filename As String) As Image
 
       ' Create an instance of Apprentice.
 
       Dim apprentice As New Inventor.ApprenticeServerComponent
 
     ' Open the specified file.
 
       Dim appDoc As Inventor.ApprenticeServerDocument = apprentice.Open(Filename)
 
       ' Create a camera.
 
       Dim cam As Inventor.Camera = apprentice.TransientObjects.CreateCamera
 
     ' Associate the camera with the part's component definition.
 
cam.SceneObject= appDoc.ComponentDefinition
 
       ' Set the camera to the desired orientation and position.
 
cam.ViewOrientationType = Inventor.ViewOrientationTypeEnum.kIsoTopRightViewOrientation
 
cam.Fit()
 
cam.ApplyWithoutTransition()
 
       ' Create an image.  Can also use SaveAsBitmap to save the image directly to a file in one of several formats.
 
       Dim picDisp As stdole.IPictureDisp
 
picDisp = cam.CreateImage(1000, 1000)
 
       ' Return the image.
 
       Return Microsoft.VisualBasic.Compatibility.VB6.IPictureDispToImage(picDisp)
 
End Function

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report