Navigation: Scripting Reference Manual > Functions & Subroutines > FacetedSurfCreateFromFile

 

FacetedSurfCreateFromFile

 

Contact Us: fredsupport@photonengr.com

 

Description

This function adds a Faceted Surface from a file on disk, returning the node number of the new surface and reporting the info and error message strings.

 

 

Syntax

fsNode = FacetedSurfCreateFromFile( tEnt, fName, infoMsg, errMsg )

 

 

Parameters

fsNode (Long)

Node number of the faceted surface that was created.

 

tEnt As T_ENTITY

Contains the generic surface entity info in a T_ENTITY data structure.

 

fName As String

Specifies the full path name to the file being used to create the faceted surface.

 

infoMsg As String

This argument contains the info string after the function has been executed.

 

errMsg As String

This argument contains the error string after the function has been executed.

 

 

Example

This example adds a new faceted surface from a file and reports the node number of the new surface as well as the info and error messages following import.  Note that the new line characters in the infoMsg and errMsg strings are replaced with semi-colons to avoid obscuration of multi-line messages printed to the output window.

 

Sub Main

 

    Dim ceNode As Long

    ceNode = FindFullName( "Geometry.Elem 1" )

 

    Dim tEnt As T_ENTITY

    Dim fName As String, infoMsg As String, errMsg As String

    Dim fsNode As Long

    InitEntity( tEnt )

        tEnt.name   = "Faceted Surface Test"

        tEnt.parent = ceNode

    fName  = "C:\temp\facetedGeometryTest.obj"

    fsNode = FacetedSurfCreateFromFile( tEnt, fName, infoMsg, errMsg )

 

    Print "Faceted surface created at node " & fsNode

    Print "Info Message: "  & Replace$( infoMsg, Chr(10), ";" )

    Print "Error Message: " & Replace$( errMsg,  Chr(10), ";" )

 

 

End Sub

 

 

See Also

T_ENTITY

FacetedSurfExportToObjFile

FacetedSurfGetUseVertexNormals

FacetedSurfGetHasVertexNormals

FacetedSurfSetFromFile

FacetedSurfSetUseVertexNormals

FacetedSurfaceGetFacetCount

 

 

 

 

 

 

Copyright © Photon Engineering, LLC