Class ImportStep
- Namespace
- CADability
- Assembly
- CADability.dll
CImport and conversion of STEP files into CADability objects. there are some global settings, which influence the import:
- StepImport.Parallel: uses multi-threading during import
- StepImport.CombineFaces: adjacent faces with the same surface may be combined to a single face
public class ImportStep
- Inheritance
-
ImportStep
- Inherited Members
Constructors
ImportStep()
Creates an importer. Set HierarchyToBlocks if wanted, then call Read(string) once.
public ImportStep()
Properties
HierarchyToBlocks
Set to true to convert the assembly structure of the file into a hierarchy of Blocks: a product with several components becomes a block that contains the components (recursively), with the product's name. False (the default) returns the solids and shells as a flat list. ReadFromFile(string, string) sets it from the global setting "ImportStep.UseHierarchy".
public bool HierarchyToBlocks { set; }
Property Value
Problems
The problems encountered by Read(string): the key is the number of the STEP entity (the number after
# in the file) that could not be imported, the value describes the problem, e.g. "face not imported"
or "closedShell with open edges". The key 0 reports a syntax error of the file. Empty when the file was
imported without problems.
public Dictionary<int, string> Problems { get; }
Property Value
Methods
ParseEnum<T>(string)
Returns the value of the enum T whose name equals value, ignoring
case. Used for the enumerations of the STEP file, e.g. .CARTESIAN.. A null or empty value is read as
"Unspecified", and a name that does not exist returns the default value of T.
public static T ParseEnum<T>(string value)
Parameters
valuestringthe name of the enum value as it appears in the STEP file, without the dots
Returns
- T
the enum value
Type Parameters
Tthe enum type
Read(string)
Reads the STEP file and returns the imported objects: Solids, open Shells, Faces and curves, or Blocks containing them when HierarchyToBlocks is set. Solids and shells are named after their products. The objects have no layer and no colour unless the file specifies one, see SetDefaults(IGeoObject). Entities that cannot be converted are skipped and reported in Problems; a file that cannot be parsed yields an empty list with the syntax error in Problems. A file that cannot be opened throws an IOException. Call this only once per instance.
public GeoObjectList Read(string filename)
Parameters
filenamestringPath of the STEP file
Returns
- GeoObjectList
The imported objects