Back to index

salome-geom  6.5.0
Functions
Importing/exporting geometrical objects
All package methods, grouped by their purpose
Collaboration diagram for Importing/exporting geometrical objects:

Functions

def geompyDC.geompyDC.ImportFile
 Import a shape from the BREP or IGES or STEP file (depends on given format) with given name.
def geompyDC.geompyDC.Import
 Deprecated analog of ImportFile()
def geompyDC.geompyDC.ImportBREP
 Shortcut to ImportFile() for BREP format.
def geompyDC.geompyDC.ImportIGES
 Shortcut to ImportFile() for IGES format.
def geompyDC.geompyDC.GetIGESUnit
 Return length unit from given IGES file.
def geompyDC.geompyDC.ImportSTEP
 Shortcut to ImportFile() for STEP format.
def geompyDC.geompyDC.Export
 Export the given shape into a file with given name.
def geompyDC.geompyDC.ExportBREP
 Shortcut to Export() for BREP format.
def geompyDC.geompyDC.ExportIGES
 Shortcut to Export() for IGES format.
def geompyDC.geompyDC.ExportSTEP
 Shortcut to Export() for STEP format.

Function Documentation

def geompyDC.geompyDC.Export (   self,
  theObject,
  theFileName,
  theFormatName 
)

Export the given shape into a file with given name.

Parameters:
theObjectShape to be stored in the file.
theFileNameName of the file to store the given shape in.
theFormatNameSpecify format for the shape storage. Available formats can be obtained with InsertOp.ImportTranslators() method.

Example

Export the given shape into a file with given name.

Parameters: 
    theObject Shape to be stored in the file.
    theFileName Name of the file to store the given shape in.
    theFormatName Specify format for the shape storage.
      Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.

Definition at line 7173 of file geompyDC.py.

07173 
07174         def Export(self,theObject, theFileName, theFormatName):
07175             """
07176             Export the given shape into a file with given name.
07177 
07178             Parameters: 
07179                 theObject Shape to be stored in the file.
07180                 theFileName Name of the file to store the given shape in.
07181                 theFormatName Specify format for the shape storage.
07182                               Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
07183             """
07184             # Example: see GEOM_TestOthers.py
07185             self.InsertOp.Export(theObject, theFileName, theFormatName)
07186             if self.InsertOp.IsDone() == 0:
07187                 raise RuntimeError,  "Export : " + self.InsertOp.GetErrorCode()
07188                 pass
07189             pass

Here is the caller graph for this function:

def geompyDC.geompyDC.ExportBREP (   self,
  theObject,
  theFileName 
)

Shortcut to Export() for BREP format.

Example

geompy.Export(...) function for BREP format

Definition at line 7193 of file geompyDC.py.

07193 
07194         def ExportBREP(self,theObject, theFileName):
07195             """
07196             geompy.Export(...) function for BREP format
07197             """
07198             # Example: see GEOM_TestOthers.py
07199             return self.Export(theObject, theFileName, "BREP")

Here is the call graph for this function:

def geompyDC.geompyDC.ExportIGES (   self,
  theObject,
  theFileName 
)

Shortcut to Export() for IGES format.

Example

geompy.Export(...) function for IGES format

Definition at line 7203 of file geompyDC.py.

07203 
07204         def ExportIGES(self,theObject, theFileName):
07205             """
07206             geompy.Export(...) function for IGES format
07207             """
07208             # Example: see GEOM_TestOthers.py
07209             return self.Export(theObject, theFileName, "IGES")

Here is the call graph for this function:

def geompyDC.geompyDC.ExportSTEP (   self,
  theObject,
  theFileName 
)

Shortcut to Export() for STEP format.

Example

geompy.Export(...) function for STEP format

Definition at line 7213 of file geompyDC.py.

07213 
07214         def ExportSTEP(self,theObject, theFileName):
07215             """
07216             geompy.Export(...) function for STEP format
07217             """
07218             # Example: see GEOM_TestOthers.py
07219             return self.Export(theObject, theFileName, "STEP")

Here is the call graph for this function:

def geompyDC.geompyDC.GetIGESUnit (   self,
  theFileName 
)

Return length unit from given IGES file.

Example

Return length unit from given IGES file

Definition at line 7135 of file geompyDC.py.

07135 
07136         def GetIGESUnit(self,theFileName):
07137             """
07138             Return length unit from given IGES file
07139             """
07140             # Example: see GEOM_TestOthers.py
07141             anObj = self.InsertOp.ImportFile(theFileName, "IGES_UNIT")
07142             #RaiseIfFailed("Import", self.InsertOp)
07143             # recieve name using returned vertex
07144             UnitName = "M"
07145             if anObj.GetShapeType() == GEOM.VERTEX:
07146                 vertices = [anObj]
07147             else:
07148                 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
07149             if len(vertices)>0:
07150                 p = self.PointCoordinates(vertices[0])
07151                 if abs(p[0]-0.01) < 1.e-6:
07152                     UnitName = "CM"
07153                 elif abs(p[0]-0.001) < 1.e-6:
07154                     UnitName = "MM"
07155             return UnitName

Here is the call graph for this function:

def geompyDC.geompyDC.Import (   self,
  theFileName,
  theFormatName 
)

Deprecated analog of ImportFile()

Deprecated analog of geompy.ImportFile

Definition at line 7103 of file geompyDC.py.

07103 
07104         def Import(self,theFileName, theFormatName):
07105             """
07106             Deprecated analog of geompy.ImportFile
07107             """
07108             print "WARNING: Function Import is deprecated, use ImportFile instead"
07109             anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
07110             RaiseIfFailed("Import", self.InsertOp)
07111             return anObj

Here is the call graph for this function:

def geompyDC.geompyDC.ImportBREP (   self,
  theFileName 
)

Shortcut to ImportFile() for BREP format.

Example

geompy.ImportFile(...) function for BREP format

Definition at line 7115 of file geompyDC.py.

07115 
07116         def ImportBREP(self,theFileName):
07117             """
07118             geompy.ImportFile(...) function for BREP format
07119             """
07120             # Example: see GEOM_TestOthers.py
07121             return self.ImportFile(theFileName, "BREP")

Here is the call graph for this function:

def geompyDC.geompyDC.ImportFile (   self,
  theFileName,
  theFormatName 
)

Import a shape from the BREP or IGES or STEP file (depends on given format) with given name.

Parameters:
theFileNameThe file, containing the shape.
theFormatNameSpecify format for the file reading. Available formats can be obtained with InsertOp.ImportTranslators() method. If format 'IGES_SCALE' is used instead 'IGES' length unit will be set to 'meter' and result model will be scaled.
Returns:
New GEOM.GEOM_Object, containing the imported shape.

Example

Import a shape from the BREP or IGES or STEP file
(depends on given format) with given name.

Parameters: 
    theFileName The file, containing the shape.
    theFormatName Specify format for the file reading.
      Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
      If format 'IGES_SCALE' is used instead 'IGES' length unit will be
      set to 'meter' and result model will be scaled.

Returns:
    New GEOM.GEOM_Object, containing the imported shape.

Definition at line 7082 of file geompyDC.py.

07082 
07083         def ImportFile(self,theFileName, theFormatName):
07084             """
07085             Import a shape from the BREP or IGES or STEP file
07086             (depends on given format) with given name.
07087 
07088             Parameters: 
07089                 theFileName The file, containing the shape.
07090                 theFormatName Specify format for the file reading.
07091                               Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
07092                               If format 'IGES_SCALE' is used instead 'IGES' length unit will be
07093                               set to 'meter' and result model will be scaled.
07094 
07095             Returns:
07096                 New GEOM.GEOM_Object, containing the imported shape.
07097             """
07098             # Example: see GEOM_TestOthers.py
07099             anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
07100             RaiseIfFailed("Import", self.InsertOp)
07101             return anObj

Here is the call graph for this function:

Here is the caller graph for this function:

def geompyDC.geompyDC.ImportIGES (   self,
  theFileName 
)

Shortcut to ImportFile() for IGES format.

Example

geompy.ImportFile(...) function for IGES format

Definition at line 7125 of file geompyDC.py.

07125 
07126         def ImportIGES(self,theFileName):
07127             """
07128             geompy.ImportFile(...) function for IGES format
07129             """
07130             # Example: see GEOM_TestOthers.py
07131             return self.ImportFile(theFileName, "IGES")

Here is the call graph for this function:

def geompyDC.geompyDC.ImportSTEP (   self,
  theFileName 
)

Shortcut to ImportFile() for STEP format.

Example

geompy.ImportFile(...) function for STEP format

Definition at line 7159 of file geompyDC.py.

07159 
07160         def ImportSTEP(self,theFileName):
07161             """
07162             geompy.ImportFile(...) function for STEP format
07163             """
07164             # Example: see GEOM_TestOthers.py
07165             return self.ImportFile(theFileName, "STEP")

Here is the call graph for this function: