How to generate Thumbnail image for Inventor drawing(.IDW) files Using Camera

How to generate Thumbnail image for Inventor drawing(.IDW) files Using Camera

vijaykumarreddy25
Contributor Contributor
287 Views
2 Replies
Message 1 of 3

How to generate Thumbnail image for Inventor drawing(.IDW) files Using Camera

vijaykumarreddy25
Contributor
Contributor

How to generate Thumbnail image for Inventor drawing(.IDW) files Using Camera

0 Likes
288 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor

Hi @vijaykumarreddy25.  Yes, this can be done, but which document will be the 'active' document at the time that you run the rule...a 'model' document, or the DrawingDocument?  And when an image is created, where do you want to save its file on disk.  What view angle of the model, and what visual style should be active, and what physical size do you want the image to be, what image file type? There are lots of little details like that.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

WCrihfield
Mentor
Mentor

Here is a very basic iLogic rule that can be ran while you have a 'model' (part or assembly) document open & active on your screen.  In included several other partial lines of code, and left them commented out, just so that you can see that there are View level (above the camera) tools available for similar tasks.  In the lower portion of the code, I have the line of code for 'oTopColor' commented out, and have shortened the method's input options, because when you do not specify a color, it will basically use the current background color of your model screen, which is often just fine.

oDoc = ThisDoc.Document
oView = oDoc.Views.Item(1)
oView.Fit
'oView.RayTracing = True
'oView.RayTracingQuality = RayTracingQualityEnum.kLowRayTracingQuality
'oView.StartRenderingRateRecord
'oView.RayTracingProgress
'oView.IsRayTracingPaused
'oView.StopRenderingRateRecord
'oView.SaveAsBitmap()
'oView.SaveAsBitmapWithOptions()
'oView.SaveAsBitmapWithRayTracing

oImageFullFileName = "C:\Temp\ViewAsBitmap1.bmp"
oWidth = oView.Width
oHeight = oView.Height
'oTopColor = ThisApplication.TransientObjects.CreateColor(255, 255, 255)
oView.Camera.Fit
oView.Camera.SaveAsBitmap(oImageFullFileName, oWidth, oHeight)', oTopColor)

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes