Navigation: Scripting Reference Manual > Data Structures > T_CADIMPORT

 

T_CADIMPORT

 

Contact Us: fredsupport@photonengr.com

 

Description

Data structure used for importing CAD files into a document.

 

 

Definition

T_CADIMPORT

drawIndependentCurves As Boolean

filename As String

localSurfOrigin As String

makeIndependentCurves As Boolean

randomUnassignedCurvColors As Boolean

randomUnassignedSurfColors As Boolean

raytraceControl As Long

reduceNURBorder As Boolean

reduceNURBtolerance As Double

simplifyCurves As Boolean

surfDrawMode As String

 

 

Members

drawIndependentCurves

Boolean indicating whether independent curve objects are drawn in the 3D view (True) or not drawn (False).

 

filename

Full directory path to the CAD file being imported.

 

localSurfOrigin

String indicating how the default global coordinate origin should be converted to a local coordinate system on the surface.  Options are:

"do not move"

"minimum (u,v)"

"average (u,v)"

When "minimum (u,v)" or "average (u,v)" are used, the local surface origin is moved to the minimum parametric u,v point or the average u,v point on the surface.

 

makeIndependentCurves

Boolean indicating whether independent curve objects are created (True) or ignored (False) on import.

 

randomUnassignedCurvColors

Boolean indicating whether curves without a color specification should be assigned random colors (True) or left a default color (False).

 

randomUnassignedSurfColors

Boolean indicating whether surfaces without a color specification should be assigned random colors (True) or left a default color (False).

 

raytraceControl

Index into the raytrace control list (0 based) indicating which raytrace property should be applied to all imported surfaces.

 

reduceNURBorder

Boolean indicating whether NURB surfaces should be reduced to the lowest possible order (True) within the maximum deviation tolerance specified by reduceNURBtolerance or left untouched (False).

 

reduceNURBtolerance

Tolerance value specifying the maximum allowed deviation between unmodified and reduced order NURB surfaces.  Only applicable when reduceNURBorder is True.

 

simplifyCurves

Boolean indicating whether NURB curves should be replaced by native FRED curves.

 

surfDrawMode

String specifying how imported surfaces are drawn in the 3D view (shaded or wire frame).  Options are:

"surface"

"wire"

 

Example

The following example initializes a T_CADIMPORT structure in preparation for importing a CAD file, imports the geometry, assigns reflective characteristics to the constituent surfaces and re-positions the new geometry at a known position.

 

Sub Main

 

    'Import reflector from STEP file

    Dim tCadImport As T_CADIMPORT

    Dim subNode As Long

    InitCADImport tCadImport

        tCadImport.filename = GetDocDir() & "\cadReflector.stp"

        tCadImport.localSurfOrigin = "average (u,v)"

        tCadImport.surfDrawMode = "wire"

    subNode = DoCADImport( tCadImport )

    Print "Imported object parent node at " & subNode

 

    'Set coating and raytrace control to all surfaces in the subassembly

    SetAllCoatingProp( subNode, FindCoating("Reflect") )

    SetAllRaytraceControlProp( subNode, FindRaytraceCtrl("Reflect Specular") )

 

    'Position reflector at a known location

    Dim op As T_OPERATION

    op.Type = "ShiftZ"

    op.parent = 2 'geometry

    op.val1 = -5

    AddOperation subNode, op

    Update

 

End Sub

 

See Also

Import/Export Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC