Solid Edge How to get texture file path and name of the texture map used in Face Style?

2021-10-06T23:52:49Z
Design

Summary


Details

How to get texture file path and name of the texture map used in Face Style?





Solution

Open any sample assembly file from training folder, then apply face Style as well as Texture from \\STx\Images\textures\granite\ folder. Run below sample program to get the texture file path and name of the texture map used in Face Style.


Imports System.IO




Imports System.Runtime.InteropServices




Imports SolidEdgeConstants




ModuleModule1




Sub Main()







Dim application As SolidEdgeFramework.Application = Nothing




Dim assemblyDocument As SolidEdgeAssembly.AssemblyDocument = Nothing




Dim occurrences As SolidEdgeAssembly.Occurrences = Nothing




Dim occurrence As SolidEdgeAssembly.Occurrence = Nothing




Dim faceStyle As SolidEdgeFramework.FaceStyle = Nothing




Try







 application = DirectCast(Marshal.GetActiveObject("SolidEdge.Application"), SolidEdgeFramework.Application)




 assemblyDocument = TryCast(application.ActiveDocument, SolidEdgeAssembly.AssemblyDocument)




If assemblyDocument IsNotNothingThen




 occurrences = assemblyDocument.Occurrences


For i AsInteger = 1 To occurrences.Count




 occurrence = occurrences.Item(1)


 faceStyle = CType(occurrence.FaceStyle, SolidEdgeFramework.FaceStyle)




 MsgBox(faceStyle.TextureFileName.ToString())


'Dim texPath As String = faceStyle.TextureFileName.ToString()




Next i




EndIf




Catch ex As System.Exception




Console.WriteLine(ex)




Finally




Console.WriteLine("GTAC")




EndTry




EndSub




EndModule



Hardware/Software Configuration

Platform: AMD64
OS: window
OS Version: 764
Product: SOLID_EDGE
Application: AUTOMATION
Function: API_DOCUMENT
Product: SOLID_EDGE
Application: AUTOMATION
Version: V110.0
Function: API_DOCUMENT

Ref: 001-9216360

KB Article ID# PL8004621

Contents

SummaryDetails

Associated Components

Part Modeling