Getting Textures/Pictures

Getting Textures/Pictures

Anonymous
Not applicable
317 Views
0 Replies
Message 1 of 1

Getting Textures/Pictures

Anonymous
Not applicable

I'am writing a tool for Inventor at the moment, which exports the open Document as an Object file.

 For Each openShell In ourDocument.ComponentDefinition.SurfaceBodies

                                        Dim _toleranceIndex As Double = 0.001
                                        Dim _vertexCount As Integer = 0
                                        Dim _facetCount As Integer = 0
                                        Dim _vertexCoor(1) As Double
                                        Dim _normalVectors(1) As Double
                                        Dim _vertexIndices(1) As Integer
                                        Dim _textureCoor(1) As Double

                                        openShell.CalculateFacetsAndTextureMap(_toleranceIndex, _vertexCount, _facetCount, _vertexCoor, _normalVectors, _vertexIndices, _textureCoor)



                                        Dim colorSource As StyleSourceTypeEnum
                                        Dim ourRenderStyle As RenderStyle

                                        Dim _r As Byte
                                        Dim _g As Byte
                                        Dim _b As Byte

                                        Dim texture As String = Nothing
                                        Dim _d As Double

                                        ourRenderStyle = openShell.GetRenderStyle(colorSource)
                                        ourRenderStyle.GetDiffuseColor(_r, _g, _b)
                                        texture = ourRenderStyle.TextureFilename
                                        _d = ourRenderStyle.Opacity

I am getting all the Information i need here

                                                Dim testFile As System.IO.FileInfo
                                                testFile = My.Computer.FileSystem.GetFileInfo(texture)
                                                Dim fileName As String = testFile.Name
                                                swMTL.WriteLine("map_Kd " & fileName)
                                                My.Computer.FileSystem.CopyFile(texture, "C:\TestText\" & fileName, Microsoft.VisualBasic.FileIO.UIOption.AllDialogs, Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)

And every Texture here.

 

This is working fine for Vertical Plate Example

 

for others e.g. the hairdryer example or projects like this: 3-bhk-india-1 i'll only get the Object itself and the color (r/g/b)

My Question is: how do i get the Texture Images from those Objects? On the Hairdryer for example the "Autodesk Inventor" logo?

 

My research so far: It is a Sketch which means i have to access the file via sketches.image (pseudo-code) (?)

0 Likes
318 Views
0 Replies
Replies (0)