pw:: Database

Global actions for database entities

Derives From

pw::Object

Summary
Global actions for database entities
This action gets a list of file types that can export all of the given entities.
This action exports the list of entities to the given file.
Import the given file into the database
This action saves the entire database in the native file format.
This action intersects database entities.
This action gets the 3D position of the given point.
This action gets the database entity of the given point.
This action offsets the uv coordinates of the given parametric database point.
This action calculates the offset from the given database point in the direction of the normal at the point.
This action gets the total length of a pw::Curve or boundary.
This action gets the corresponding pw::Curve for a boundary, if any
This action gets the closest point on a database entity from a given point.
This action gets the ray intersection on a database entity from a given ray.
This action checks if this database contains entities that can be projected onto using the project command.
This action gets a list of all entities in the database.
This action gets the number of entities in the database.
This action gets a database entity using the name.
This action gets the extents of the database.
This action gets the same point tolerance for database operations.
This action gets the fit tolerance for database operations.
This attribute is the model size of the database used to determine tolerances.
This attribute is the visiblity mode of database import.
This attribute is the bending angle that shell database entities are split at on import.
This attribute notifies how shell cells should be handled on import.
This attribute notifies if the auto split should happen on import.

Static Actions

getExportFileTypes

pw::Database getExportFileTypes dbentity_list

This action gets a list of file types that can export all of the given entities.

Parameters

dbentity_listThis parameter is a list of pw::DatabaseEntity objects, or a single pw::DatabaseEntity object.

Returns

This action returns a list containing file type name strings that can be used in the export command.

export

pw::Database export ?-type file_type? ?-format file_format? ?-precision fp_precision? ?-noOverwrite? dbentity_list filename

This action exports the list of entities to the given file.

Parameters

-type file_typeThis optional parameter is the string file type of the file with options < Automatic | Gridgen | IGES | STL | VRML | PLOT3D | Segment | Patran | Nastran | UCD | Xpatch | NMB >.
-format file_formatThis optional parameter is the string file format of the exported file with options < ASCII | Binary | Unformatted >.
-precision fp_precisionThis optional parameter is the floating point precision string of the exported file with options < Double | Single >.  The default is Double.
-noOverwriteThis optional flag is the notification to not overwrite existing export files.
dbentity_listThis parameter is a list of pw::DatabaseEntity objects, or a single pw::DatabaseEntity object.
filenameThis parameter is the string full path and name of the file to export.

Returns

This action returns nothing.

Information

This command supports progress updates.

File Types

Automaticdetermine the file type based on the filename extension
GridgenGridgen database file format
IGESInitial Graphics Exchange Specification v5.3
STLStereo Lithography file format
VRMLVRML 1.0 format
VRML97VRML 2.0/97 format
PLOT3D3D, multi-grid format with kmax=1 and no i-blanking
SegmentGridgen connector and line file format
PatranPatran version 2.5 Neutral file format
NastranNastran version 69 format, Double precision refers to “large” format real numbers (16 characters)
UCDAdvanced Visual Systems’ unstructured cell data file format
XpatchXpatch unstructured data file format
NMBGE data file format
For file_format A = ASCII, B = Binary, U = Unformatted

file_type extension file_format fp_precision valid entity types
============= =========== =========== ================ =========================
Gridgen dba A Double any
IGES igs,iges A Double any except shells
STL stl A|B Single shells
VRML wrl,vrml A Single shells, bilinear surfaces
VRML97 wrl,vrml A Single shells, bilinear surfaces
PLOT3D x,xyz,p3d A|B|U Double|Single bilinear surfaces
Segment dat A Double|Single linear curves
Patran pat A Single* shells, curves, surfaces
Nastran nas A Double|Single** shells, bilinear surfaces
UCD ucd A Double|Single shells
Xpatch facet A Double|Single shells
NMB nmb A|B Double any

* The Patran format uses a fixed width field giving 10 digits of
precision (single = 7 digits, double = 16 digits).
** The Nastran format uses a fixed width field giving 10 digits of
precision (single = 7 digits, double = 16 digits), however the
precision field is used to specify the style of Nastran export,
where Single will generate the small NASTRAN format and Double
will generate the large field NASTRAN-L format.

import

pw::Database import ?-type file_type? ?-format file_format? ?-precision fp_precision? ?-duplicates dup_mode? ?-report report_var? filename

Import the given file into the database

Parameters

-type file_typeThis optional parameter is the string file type of the file with options < Automatic | Gridgen | IGES | STL | VRML | PLOT3D | Network |Segment | Patran | Nastran | UCD | Xpatch | UGRID | NMB | NMBDirect | CAD >.  The default is Automatic.
-format file_formatThis optional parameter is the string file format of the exported file with options < ASCII | Binary | Unformatted >.  The default is ASCII.
-precision fp_precisionThis optional parameter is the floating point precision string of the imported file with options < Double | Single >.  The default is Double.
-duplicates dup_modeThis optional parameter is the duplication mode for importing entities with existing names with options < Abort | Skip | Rename >.  The default is Abort.
-report report_varThis optional parameter is a variable name to recieve a string reporting the low-level details of the import.
filenameThis parameter is the string full path and name of the file to import.

Returns

This action returns a list of the imported pw::DatabaseEntity objects.

Information

This command supports progress updates.

File Types

Automaticdetermine the file type based on the filename extension
GridgenGridgen database file format
IGESInitial Graphics Exchange Specification v5.3
STLStereo Lithography file format
VRMLVRML 1.0 or 97 format
PLOT3D3D, multi-grid format with kmax=1 and no i-blanking
SegmentGridgen connector and line file format
NetworkGridgen structured grid and network surface file format
PatranPatran version 2.5 Neutral file format
NastranNastran version 69 format, Double precision refers to “large” format real numbers (16 characters)
UCDAdvanced Visual Systems’ unstructured cell data file format
XpatchXpatch unstructured data file format
UGRID2D/3D unstructured grid format
NMBGE data file format
CADOne of the supported Native CAD Reader file formats

Supported CAD Formats

ACIS SatDassault Systems, Spatial ACIS SAT file format
CATIAV4Dassault Systems CATIA V4 file format
CATIAV5Dassault Systems CATIA V5 file format
CreoPTC Creo file format (formally Pro/ENGINEER)
ParasolidsSiemens, Parasolid format
ProENGINEERPTC Pro/ENGINEER format (now called Creo)
SOLIDWORKSDassault Systems, SOLIDWORKS file format
STEPStandard for the Exchange of Product Model Data file format
NXSiemens NX file format (formally Unigraphics)
For file_format A = ASCII, B = Binary, U = Unformatted

file_type extension file_format fp_precision valid types
============= =========== =========== ================ ======================
Gridgen dba A Double any
IGES igs,iges A Double any
STL stl A|B Single shells
VRML wrl,vrml A Single shells
PLOT3D x,xyz,p3d A|B|U Double|Single bilinear surfaces
Network grd,net A|B|U Double|Single bilinear surfaces
Segment dat A Double|Single linear curves
Patran pat A Single* curves, surfaces
Nastran nas A Double|Single** shells
UCD ucd A Double|Single shells
Xpatch facet A Double|Single shells
UGRID ugrid A|B|U Double|Single shells
NMB nmb A|B Double any except notes
CAD see CAD formats below...

CAD formats:
format extension file_format fp_precision valid types
============= ================== =========== ================ ===============
ACIS Sat sat B Double any
CATIAV4 model B Double any
CATIAV5 CATProduct,CATPart B Double any
Creo asm,prt B Double any
Parasolids x_t,x_b B Double any
ProENGINEER asm,prt B Double any
SOLIDWORKS sldasm,sldprt B Double any
STEP stp,step A Double any
NX prt B Double any

* The Patran format uses a fixed width field giving 10 digits of
precision (single = 7 digits, double = 16 digits)

** The Nastran format uses a fixed width field giving 10 digits of
precision (single = 7 digits, double = 16 digits), however the
precision field is used to specify the style of Nastran import,
where Single will generate the small NASTRAN format and Double
will generate the large field NASTRAN-L format.

Compatibility with DatabaseImporter mode

For backward compatability, the import defaults for this action are not the same as the defaults when using a DatabaseImporter mode.  As you can see in the defaults listed below.  All values are the same except for EntityVisibility and ShellCellMode.

DatabaseImporter attr      Default value          | Default value      pw::Database attr/param
------------------------- ---------------------- | ----------------- -----------------------
EntityIgnoreIfNameUsed false | false -duplicates
EntityVisibility ImportAndHideSupports | Import ImportVisibility
FileModelSizeFromFile true | true n/a
FileUnits FromFile | FromFile n/a
ModelFromFreeSurface false | false n/a
ModelAssembleTolerance 0 | 0 n/a
QuiltAssembleAngle 0 | 0 n/a
ShellCellMode MergeCoplanar | AsTriangles ImportShellCellMode
ShellSplitAngle 0.0 | 0.0 ImportShellSplitAngle
SurfaceSplitDiscontinuous false | false ImportAutoSplitSurfaces

To make shell import behavior the same, you can use <pw::Database setImportShellCellMode MergeCoplanar>.

However, due to the limited settings available for <pw::Database setImportVisibility>, you cannot make their behaviors match exactly.  The value mapping is shown below.  To set visibility behavior to ImportAndHideSupports or to gain access to the other mode attributes not available (n/a) using pw::Database, you must use a DatabaseImporter mode.

pw::Database       DatabaseImporter
ImportVisibility EntityVisibility
---------------- ----------------------
true Import
false ShowAllAndHideSupports

save

pw::Database save ?-compress level? ?-noOverwrite? filename

This action saves the entire database in the native file format.

Parameters

-compress levelThis optional parameter sets the integer file compression level with the range [0, 9].  The default is 0.
-noOverwriteThis optional flag is notification to not save if filename already exists.
filenameThis parameter is the full path and name string of the file to save.

Returns

This action returns nothing.

Information

This command supports progress updates.

For “-compress level”, 0 = no compression, 1 = minimum, and 9 = maximum.  Higher levels of compression take longer to save.

intersect

pw::Database intersect ?-tolerance tol? ?-actual do_actual? ?-apparent line_of_sight? ?-closest max_dist? dbentity_list1 ?dbentity_list2?

This action intersects database entities.

Parameters

-tolerance tolThis optional flag is the float same point tolerance used during intersection calculation with the range [0, infinity).  The default is same point tolerance.
-actual do_actualThis optional flag is the boolean parameter for whether actual intersection should be done.  The default is true.
-apparent line_of_sightThis optional parameter is the line of sight vector for apparent intersections of curves, which will only be included if this argument is present.
-closest max_distThis optional parameter is the float maximum distance for closest point “intersections” of curves, which will only be included if this argument is present with the range [0, infinity), where 0 is no limit.
dbentity_list1This parameter is a list of pw::DatabaseEntity objects, or a single pw::DatabaseEntity object.
dbentity_list2This parameter is a list of pw::DatabaseEntity objects, or a single pw::DatabaseEntity object.

Returns

This action returns a list of the newly created pw::DatabaseEntity objects.

Information

If only dbentity_list1 is specified, the entities in this list are intersected with themselves.

If both dbentity_list1 and dbentity_list2 are specified, the entities in dbentity_list1 are intersected with the entities in dbentity_list2.

This command supports progress updates.

getXYZ

pw::Database getXYZ point

This action gets the 3D position of the given point.

Parameters

pointThis parameter is a point.

Returns

This action returns an xyz vector.

getEntity

pw::Database getEntity point

This action gets the database entity of the given point.

Parameters

pointThis parameter is a point.

Returns

This action returns a pw::DatabaseEntity object.

Information

If the given point is not database constrained, an error will occur.

offsetUV

pw::Database offsetUV point < u | uv >

This action offsets the uv coordinates of the given parametric database point.

Parameters

pointThis parameter is a point in the form “u v dbentity”.
uThis parameter is the float u amount to offset.
uvThis parameter is the vector uv amount to offset.

Returns

This action returns a point in the form “u v dbentity”.

Information

If the given point is not parametric database constrained, an error will occur.

offsetNormal

pw::Database offsetNormal point distance

This action calculates the offset from the given database point in the direction of the normal at the point.

Parameters

pointThis parameter is a point.
distanceThis parameter is the float distance to offset.

Returns

This action returns an xyz vector.

Information

If the given point is not database constrained, or the normal is not defined for the database entity, an error will occur.

getTotalLength

pw::Database getTotalLength < curve | boundary >

This action gets the total length of a pw::Curve or boundary.

Parameters

curveThis parameter is the pw::Curve object to get the total length of.
boundaryThis parameter is the boundary to get the total length of.

Returns

This action returns the float length which has the range [0.0, infinity).

getCurve

pw::Database getCurve boundary

This action gets the corresponding pw::Curve for a boundary, if any

Parameters

boundaryThis parameter is the boundary for which the corresponding pw::Curve will be returned, if one exists.

Returns

The pw::Curve corresponding to a boundary.  If no pw::Curve exists, an error will be raised.

closestPoint

pw::Database closestPoint ?-parametric? ?-projection? ?-explicit ents? ?-state stateVar? point ?dir?

This action gets the closest point on a database entity from a given point.

Parameters

-parametricThis optional flag is the notification to restrict the closest point found to be on a curve, surface, trimmed surface, or quilt.  This option can be combined with -projection.
-projectionThis optional flag is the notification to restrict the closest point found to be on an entity that other entities can be projected onto, such as a surface, trimmed surface, quilt or shell.  This option can be combined with -parametric.
-explicit entsThis optional parameter restricts the closest point found to be on the given entities in the list of pw::DatabaseEntity objects.  If given, the -parametic and -projection flags will be ignored.
-state stateVarThis optional parameter will indicate on return if a surface was found (true) or not (false).
pointThis parameter is the point that is projected onto the current database entities.
dirThis parameter is a direction vector for finding the closest point from a ray.

Returns

This action returns a point, in the parameter space of the closest database entity, if there is no closest point this action will return the given point.  Also, if -state stateVar is used, stateVar indicates whether a surface was found or not.

intersectRay

pw::Database intersectRay ?-parametric? ?-projection? ?-explicit ents? ?-state stateVar? point dir

This action gets the ray intersection on a database entity from a given ray.  This function ignores all non-surface entities like curves or points.

Parameters

-parametricThis optional flag is the notification to restrict the closest point found to be on a surface, trimmed surface, or quilt.  This option can be combined with -projection.
-projectionThis optional flag is the notification to restrict the closest point found to be on an entity that other entities can be projected onto, such as a surface, trimmed surface, quilt or shell.  This option can be combined with -parametric.
-explicit entsThis optional parameter restricts the intersection found to be on the given entities in the list of pw::DatabaseEntity objects.  If given, the -parametic and -projection flags will be ignored.
-state stateVarThis optional parameter will indicate on return if a surface was found (true) or not (false).
pointThis parameter is the point that is the start of the ray.
dirThis parameter is a direction vector for the ray.

Returns

This action returns a point, in the parameter space of the intersected database entity, if there is no intersection point this action will return the given point.  Also, if -state stateVar is used, stateVar indicates whether a surface was found or not.

isBaseForProject

pw::Database isBaseForProject

This action checks if this database contains entities that can be projected onto using the project command.

Parameters

This action has no parameters.

Returns

This action returns boolean, true if the database contains entities that can be projected onto.

getAll

pw::Database getAll

This action gets a list of all entities in the database.

Parameters

This action has no parameters.

Returns

This action returns a list of pw::DatabaseEntity objects.

getCount

pw::Database getCount

This action gets the number of entities in the database.

Parameters

This action has no parameters.

Returns

This action returns an integer value.

getByName

pw::Database getByName name

This action gets a database entity using the name.

Parameters

nameThis parameter is a name string.

Returns

This action returns a pw::DatabaseEntity object.

getExtents

pw::Database getExtents ?-enabledOnly? ?-visibleOnly?

This action gets the extents of the database.

Parameters

-enabledOnlyThis flag, if present, restricts the calculations to only enabled entities, regardless of their visibility.  Enabled entities in off layers are included, for example.
-visibleOnlyThis flag, if present, restricts the calculations to only visible entities.

Returns

This action returns a list of two vectors representing the min and max xyz points of the extents.

getSamePointTolerance

pw::Database getSamePointTolerance

This action gets the same point tolerance for database operations.

Parameters

This action has no parameters.

Returns

This action returns the float tolerance.

getFitTolerance

pw::Database getFitTolerance

This action gets the fit tolerance for database operations.

Parameters

This action has no parameters.

Returns

This action returns the float tolerance.

Static Attributes

ModelSize

pw::Database get/setModelSize size

This attribute is the model size of the database used to determine tolerances.

Type

This attribute is a float with the range (0, infinity).

Default

The default for this attribute is 1000.0.

ImportVisibility

pw::Database get/setImportVisibility import

This attribute is the visiblity mode of database import.

Type

This attribute is a boolean.

Default

The default for this attribute is true.

Information

If this attribute is true, entity visibility data is imported from database files.  If this attribute is false, entity visibility is determined automatically.

ImportShellSplitAngle

pw::Database get/setImportShellSplitAngle angle

This attribute is the bending angle that shell database entities are split at on import.

Type

This attribute is a float with the range [0, 180].

Default

The default for this attribute is 0.

ImportShellCellMode

pw::Database get/setImportShellCellMode mode

This attribute notifies how shell cells should be handled on import.

Type

This attribute is of type string; < AsTriangles | AsTrianglesAndQuadrilaterals | AsIs | MergeCoplanar ).

Default

The default for this attribute is AsTriangles.

ImportAutoSplitSurfaces

pw::Database get/setImportAutoSplitSurfaces split

This attribute notifies if the auto split should happen on import.

Type

This attribute is a boolean.

Default

The default for this attribute is false.

Information

If this attribute is true, Db surfaces will be split on import.  If this attribute is false, Db surfaces will not be split on import.

pw::Database getExportFileTypes dbentity_list
This action gets a list of file types that can export all of the given entities.
pw::Database export ?-type file_type? ?-format file_format? ?-precision fp_precision? ?-noOverwrite? dbentity_list filename
This action exports the list of entities to the given file.
pw::Database import ?-type file_type? ?-format file_format? ?-precision fp_precision? ?-duplicates dup_mode? ?-report report_var? filename
Import the given file into the database
pw::Database save ?-compress level? ?-noOverwrite? filename
This action saves the entire database in the native file format.
pw::Database intersect ?-tolerance tol? ?-actual do_actual? ?-apparent line_of_sight? ?-closest max_dist? dbentity_list1 ?dbentity_list2?
This action intersects database entities.
pw::Database getXYZ point
This action gets the 3D position of the given point.
pw::Database getEntity point
This action gets the database entity of the given point.
pw::Database offsetUV point < u | uv >
This action offsets the uv coordinates of the given parametric database point.
pw::Database offsetNormal point distance
This action calculates the offset from the given database point in the direction of the normal at the point.
pw::Database getTotalLength < curve | boundary >
This action gets the total length of a pw::Curve or boundary.
Database curve type
A boundary is reference to either a database curve or the edge of a database surface.
pw::Database getCurve boundary
This action gets the corresponding pw::Curve for a boundary, if any
pw::Database closestPoint ?-parametric? ?-projection? ?-explicit ents? ?-state stateVar? point ?dir?
This action gets the closest point on a database entity from a given point.
pw::Database intersectRay ?-parametric? ?-projection? ?-explicit ents? ?-state stateVar? point dir
This action gets the ray intersection on a database entity from a given ray.
pw::Database isBaseForProject
This action checks if this database contains entities that can be projected onto using the project command.
pw::Database getAll
This action gets a list of all entities in the database.
pw::Database getCount
This action gets the number of entities in the database.
pw::Database getByName name
This action gets a database entity using the name.
pw::Database getExtents ?-enabledOnly? ?-visibleOnly?
This action gets the extents of the database.
pw::Database getSamePointTolerance
This action gets the same point tolerance for database operations.
pw::Database getFitTolerance
This action gets the fit tolerance for database operations.
pw::Database get/setModelSize size
This attribute is the model size of the database used to determine tolerances.
pw::Database get/setImportVisibility import
This attribute is the visiblity mode of database import.
pw::Database get/setImportShellSplitAngle angle
This attribute is the bending angle that shell database entities are split at on import.
pw::Database get/setImportShellCellMode mode
This attribute notifies how shell cells should be handled on import.
pw::Database get/setImportAutoSplitSurfaces split
This attribute notifies if the auto split should happen on import.
Base type for all glyph types
Base type for all database entities
A string is an array of characters.
The DatabaseImporter IO mode type
Global actions for database entities
An integer is a whole number.
A float is a fractional number.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
A vector is a list of float values.
A point is a position either in model space or database parameter space.