pw::DatabaseEntity

Base type for all database entities

Derives From

pw::Object pw::Entity

Summary
pw::DatabaseEntityBase type for all database entities
Static Actions
closestApproachThis action returns the smallest distance or closest approach between the given database entities.
getAdjacentEntitiesThis action returns a list of db entities adjacent to the given entities.
getByNameThis action gets a database entity using the name.
getBySequenceThis action gets a database entity using the sequence number.
Instance Actions
deleteThis action deletes this entity.
transformThis action transforms this entity by the given matrix.
closestPointThis action gets the closest point on this entity to the given point or ray.
isDefinedThis action checks if this entity is defined.
isParametricThis action checks if this entity is parametric.
isCurveThis action checks if this entity is curve-like.
isSurfaceThis action checks if this entity is surface-like.
isBaseForProjectThis action checks if this entity can be projected onto using a project command.
isBaseForConnectorThis action checks if connectors can be built on the entity using the pw::Connector.createOnDatabase command.
isBaseForDomainStructuredThis action checks if domains can be built on the entity using the pw::DomainStructured.createOnDatabase command.
isBaseForDomainUnstructuredThis action checks if domains can be built on the entity using the pw::DomainUnstructured.createOnDatabase command.
getDescriptionThis action gets the description of how this entity was defined.
getPartCountThis action gets the number of parts of the entity of a given type.
getPartThis action gets a string representing a part of the entity that can be used to reference the part in other actions.
getPartsThis action gets a list of strings representing parts of the entity that can be used to reference the part in other actions.
getPartOwnerThis action gets the DatabaseEntity object that owns the given part of this entity and the part name within that entity.
getPartOwnersThis action gets a list of the DatabaseEntity object that owns the given parts of this entity and the part name within that entity.
getPartXYZThis action gets the xyz vector for the given part of this entity.
getPartXYZsThis action gets a list of xyz vectors for the given parts of this entity.
getPartBoundaryThis action gets the entity boundary for the given part of this entity.
getAttributeDictionaryNamesThis action gets a list of string names for the available attribute dictionaries set on this entity.
getAttributeDictionaryThis action gets a dictionary of key-value pairs of attributes that have been set on this entity with the given dictionary name.
setAttributeDictionaryThis action sets a dictionary of key-value pairs on this entity with the given dictionary name.
updateAttributeDictionaryThis action updates the attribute dictionary that has been set on this entity with the given name for the given key-value pair.
renameAttributeDictionaryThis action renames an attribute dictionary that has been set on this entity.
renameAttributeDictionaryKeyThis action renames an attribute dictionary key that has been set on this entity.
getAttachedAttributeDictionariesThis action returns a list of pw::AttributeDictionary objects that are attached to this entity.
getAttachedAttributePartsThis action returns a list of string part names that are attached to the given <pw::AttributeDicitionary> object.
attachAttributeDictionaryThis action attaches a pw::AttributeDictionary object to this entity.
detachAttributeDictionaryThis action detaches a pw::AttributeDictionary object from this entity.
getImportedAttributeThis action gets the type and value of an entity attribute.
getImportedAttributeNamesThis action gets the entity’s available attribute names.
getSupportEntitiesThis action gets the entities that this entity requires.
getDependentEntitiesThis action gets the entities that require this entity to exist.
getReferencingEntitiesThis action gets the entities that reference this entity, but not necessarily depend on it to support.
getGridEntitiesThis action gets the grid entities that this entity supports.

Static Actions

closestApproach

pw::DatabaseEntity closestApproach ?-seed seedPt? -result1Var pt1? ?-result2Var pt2? entities1 entities2

This action returns the smallest distance or closest approach between the given database entities.

Parameters

-seed seedPtThis optional parameter is a point that is used as a seed point for the algorithm.  The default is NULL.
-result1Var pt1This optional parameter is the string name of a variable to receive the point on entities1 that is nearest entities2.
-result2Var pt2This optional parameter is the string name of a variable to receive the point on entities2 that is nearest entities1.
entities1list of pw::DatabaseEntity objects to be used as one side of the closest approach search.
entities2list of pw::DatabaseEntity objects to be used as one side of the closest approach search.

Returns

This action returns the distance between the given pw::DatabaseEntity objects.  An error is returned if the distance could not be determined.

Information

The -seed parameter is optional, but may be used to help the algorithm find the desired nearest distance in the event there are local minimum/maximum that might make it difficult or impossible for the algorithm to locate the desired distance.

If either of the -result1Var or -result2Var flags are specified, they will contain point objects that indicate the locations on the given entities where they are nearest one another.

Example

This example shows how to get the distance between two pw::DatabaseEntity objects as well as the corresponding point entities.  It also demonstrates how to obtain the XYZ locations from the point objects.

Code

set sphere(1) [pw::Database getByName "sphere-1"]
set sphere(2) [pw::Database getByName "sphere-2"]
set distance \
    [pw::DatabaseEntity closestApproach -result1Var pt1 \
    -result2Var pt2 $sphere(1) $sphere(2)]
puts "Distance is $distance"
puts "result1Var XYZ: [pw::Database getXYZ $pt1]"
puts "result2Var XYZ: [pw::Database getXYZ $pt2]"

Output

Distance is 1.0
result1Var XYZ: -0.5 0.0 0.0
result2Var XYZ: 0.5 0.0 0.0

getAdjacentEntities

pw::DatabaseEntity getAdjacentEntities ?-tolerance tol? ?-maximumAngle angle? ?-all? ents

This action returns a list of db entities adjacent to the given entities.

Parameters

-tolerance tolThis optional parameter is the float tolerance used to find adjacent entities.  The default is fit tolerance.
-maximumAngle angleThis parameter is the float maximum bend angle for considering entities as adjacent with the range [0, 180].  The default is 180.
-allThis optional flag is the notification to continue looking for adjacent entities as new ones are added.
entslist of pw::DatabaseEntity objects to be used as the seed

Returns

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

Information

If the -all flag is specified, the process is repeated until no more adjacent entities are found.

The return list will not include any entities specified in the argument list.

Database entities are only considered adjacent for certain types;

Example

This example shows how to get quilts adjacent to a given quilt in order to assemble them.  The -all option is used to continue finding adjacent quilts to the ones already added.  The original quilt must then be added to the list before assembly.

Code

set quilt(1) [pw::Database getByName "quilt-1"]
set adjQuilts \
    [pw::DatabaseEntity getAdjacentEntities -all $quilt(1)]
lappend adjQuilts $quilt(1)
foreach db $adjQuilts {
    puts [$db getName]
}
pw::Quilt assemble $adjQuilts

Output

quilt-2
quilt-3
quilt-4
quilt-1

See Also

pw::Quilt

getByName

pw::DatabaseEntity getByName ?-path path? 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.  -path path - This parameter and its argument specify the path to the framework in which the database entity resides.  The path argument must be a list of either pw::Framework objects or framework names.  The path must start at the root framework, start at the active framework, or start at a child of the active framework.  The active framework is used as the default if this parameter is not specified.

Example

This example shows how to get a database entity named model-1 in order to find out how many quilts are in that model.

Code

set mdl(1) [pw::DatabaseEntity getByName "model-1"]
puts "[$mdl(1) getName] has [$mdl(1) getQuiltCount] quilts."

Output

model-1 has 188 quilts.

See Also

pw::Model

getBySequence

pw::DatabaseEntity getBySequence number

This action gets a database entity using the sequence number.

Parameters

numberThis parameter is the integer sequence number with the range [1, entity count].

Returns

This action returns a pw::DatabaseEntity object.

Notes

This function is extremely inefficient for querying the entire database system.  It is much more efficient to call pw::Database.getAll and simply index into the returned list.

Example

Code

set db [pw::DatabaseEntity getBySequence 11]
puts "[$db getName] is of the type [$db getType]."

Output

BSurf-425 is of the type pw::Surface.

Instance Actions

delete

$entity delete ?-force? ?-dependents?

This action deletes this entity.

Parameters

-forceThis optional flag is the notification that the entity will be deleted, even if grid entities reference it.
-dependentsThis optional flag is the notification that the entity will be deleted along with any dependent database entities.

Returns

This action returns nothing.

Example

This example shows how to delete $mdl(1), which is referencing an existing model.  The -dependents parameter causes all quilts and other hidden database entities that depend on the model to be deleted also.

Code

$mdl(1) delete -dependents

transform

$entity transform matrix

This action transforms this entity by the given matrix.  The matrix is a list of 16 values, but in practice, the utility functions for transform matrices are generally used instead.

Parameters

matrixThis parameter is the 4x4 transform matrix.

Returns

This action returns nothing.

Example

This example shows how to scale database entities using a transform utility command that sets an anchor point from the uv vector “0 0” on $crv(1) and a scaling vector of “5 5 0” to form the matrix.  $crv(1) is referencing an existing database curve.

Code

$crv(1) transform [pwu::Transform scaling -anchor \
    [pw::Application getXYZ [list 0 0 $crv(1)]] {5 5 0}]

See Also

pwu::Transform

closestPoint

$entity closestPoint ?-from fromVar? ?-distance distVar? ?-interval limits? point ?dir?

This action gets the closest point on this entity to the given point or ray.

Parameters

-from fromVarThis optional parameter is the string name of a variable to receive the xyz of the given point or the point along the ray that is closest to this entity.
-distance distVarThis optional parameter is the string name of a variable to receive the float distance between the given point or ray and the point entity.
-interval limitsThis optional parameter is a vector of normalized curve parameters to restrict the closest point to a portion of the curve.
pointThis parameter is the point that is projected onto this database entity.
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 this database entity, if there is no closest point this action will return the origin.  Interval limit is only applicable to curve entities.

Example

This example finds the closest point in parameter space on $mdl(1) from the given point “0 0 10”.  The -distance parameter is used to find the distance between the points.  $mdl(1) is referencing an existing model.

Code

set pt [$mdl(1) closestPoint -distance dist [list 0 0 10]]
puts [pw::Application getDescription $pt]
puts "The UV point is $dist units from the given point."

Output

quilt-1 (0.00596421,0)
The UV point is 16.379883785930257 units from the given point.

isDefined

$entity isDefined

This action checks if this entity is defined.

Parameters

This action has no parameters.

Returns

This action returns a boolean, true if the entity is defined.

Example

This example checks to see if $mdl(1) is defined.  $mdl(1) is referencing an existing model.

Code

puts [$mdl(1) isDefined]

Output

1

isParametric

$entity isParametric

This action checks if this entity is parametric.

Parameters

This action has no parameters.

Returns

This action returns a boolean, true if the entity is parametric.

Example

This example checks to see if $mdl(1) is parametric.  $mdl(1) is referencing an existing model.

Code

puts [$mdl(1) isParametric]

Output

0

isCurve

$entity isCurve

This action checks if this entity is curve-like.

Parameters

THis action has no parameters.

Returns

This action returns a boolean, true if the entity is a curve.

Example

This example checks to see if $crv(1) is curve-like.  $crv(1) is referencing an existing database curve.

Code

puts [$crv(1) isCurve]

Output

1

isSurface

$entity isSurface

This action checks if this entity is surface-like.

Parameters

This action has no parameters.

Returns

This action returns a boolean, true if the entity is a surface.

Example

This example checks to see if $crv(1) is surface-like.  $crv(1) is referencing an existing database curve.

Code

puts [$crv(1) isSurface]

Output

0

isBaseForProject

$entity isBaseForProject

This action checks if this entity can be projected onto using a project command.

Parameters

This action has no parameters.

Returns

This action returns a boolean, true if the entity is a target for projection.

Example

This example checks to see if $mdl(1) can be projected onto.  $mdl(1) is referencing an existing model.

Code

puts [$mdl(1) isBaseForProject]

Output

0

See Also

pw::Entity.project pw::GridEntity.project pw::Curve.project pw::Connector.project <pw::Domain.project>

isBaseForConnector

$entity isBaseForConnector

This action checks if connectors can be built on the entity using the pw::Connector.createOnDatabase command.

Parameters

This action has no parameters.

Returns

This action returns a boolean, true if the entity is a base for connectors.

Example

This example checks to see if $qlt(1) can have connectors built on it.  $qlt(1) is referencing an existing quilt.

Code

puts [$qlt(1) isBaseForConnector]

Output

1

isBaseForDomainStructured

$entity isBaseForDomainStructured

This action checks if domains can be built on the entity using the pw::DomainStructured.createOnDatabase command.

Parameters

This action has no parameters.

Returns

This action returns a boolean, true if the entity is a base for strcutured domains.

Example

This example checks to see if $qlt(1) can have structured domains built on it.  $qlt(1) is referencing an existing quilt.

Code

puts [$qlt(1) isBaseForDomainStructured]

Output

1

isBaseForDomainUnstructured

$entity isBaseForDomainUnstructured

This action checks if domains can be built on the entity using the pw::DomainUnstructured.createOnDatabase command.

Parameters

This action has no parameters.

Returns

This action returns a boolean, true if the entity is a base for unstrcutured domains.

Example

This example checks to see if $qlt(1) can have unstructured domains built on it.  $qlt(1) is referencing an existing quilt.

Code

puts [$qlt(1) isBaseForDomainUnstructured]

Output

1

getDescription

$entity getDescription

This action gets the description of how this entity was defined.

Parameters

This action has no parameters.

Returns

This action returns a string description.

Information

All possible string returns: AkimaSpline, AveragePoint, BezierSpline, BSplineCurve, BSplineSurface, Boundary, BoundedSurface, CatmullRomSpline, Circle, CompositeCurve, CompositeSurface, ConeSurface, ConicCurve, CoonsSurface, Copious, CurveOnSurface, CylinderSurface, Edge, Face, FilletSurface, Group, IntersectionCurve, IntersectionPoint, Line, LinearSpline, LinearSweep, Loop, Model, Note, OffsetCurve, OffsetSurface, OpenModel, ParametricCurve, ParametricSurface, Plane, PlaneSurface, Point, ProjectedCurve, Quilt, RuledSurface, Shell, SolidModel, SphereSurface, SubfigureDefinition, SubfigureInstance, Revolution, TabulatedCylinder, ToroidalSurface, TrimmedCurve, TrimmedSurface, Unknown, Vertex.

Example

This example shows how to get the description for $crv(1).  $crv(1) is referencing an existing database curve.

Code

puts [$crv(1) getDescription]

Output

LinearSpline

getPartCount

$entity getPartCount part_type

This action gets the number of parts of the entity of a given type.

Parameters

part_typeThis parameter is the string type of the part to get.  Valid values are < Region | Shell | Sheet | Face | Loop | Costring | Coedge | String | Edge | Vertex >.

Returns

This action returns the integer number of parts of the entity

Information

Some database entities are constructed from several internal parts which may need to be addressed by different actions, but the parts themselves are not considered entities.  This action is used in combination with getPart to build a string that can be used to reference these internal parts.

getPart

$entity getPart part_type < index | point | boundary >

This action gets a string representing a part of the entity that can be used to reference the part in other actions.

Parameters

part_typeThis parameter is the string type of the part to get.  Valid values are < Region | Shell | Sheet | Face | Loop | Costring | Coedge | String | Edge | Vertex >.
indexThis parameter is the integer index of the part to get with range [1, count of part type].
pointThis parameter is a point that is constrained to or geometrically near the part to get.
boundaryThis parameter is a boundary that is constrained to the part to get.

Information

Some database entities are constructed from several internal parts which may need to be addressed by different actions, but the parts themselves are not considered entities.  This action is used in combination with getPartCount to build a string that can be used to reference these internal parts.

Returns

This action returns a string representing the part for use by other acitions.

getParts

$entity getParts ?-filter filter? part_type

This action gets a list of strings representing parts of the entity that can be used to reference the part in other actions.

Parameters

-filter filterThis optional parameter is a string to limit the parts returned by this action.  If not given, this action returns all of the entity’s parts.  See below for valid filters.
part_typeThis parameter is the string type of the part to get.  Valid values are < Region | Shell | Sheet | Face | Loop | Costring | Coedge | String | Edge | Vertex >.

Returns

This action returns a list of strings representing the parts for use by other acitions.

Information

Valid filters and what they do: Corners - Only return the Vertices that are at the ends of strings

getPartOwner

$entity getPartOwner part_name

This action gets the DatabaseEntity object that owns the given part of this entity and the part name within that entity.  This is only meaningful in the context of Model, Quilt and SurfaceTrim entities that share parts.  In all other cases, this action will return itself and the given part name.

Parameters

part_nameThis parameter is the string part name within the entity to get the owner of.  Only strings returned by getPart should be used for this parameter.

Returns

This action returns a list of the DatabaseEntity object representing the entity that owns the given part of this entity, and the part name of the part with respect to the owning entity.

getPartOwners

$entity getPartOwners part_names

This action gets a list of the DatabaseEntity object that owns the given parts of this entity and the part name within that entity.  This is only meaningful in the context of Model, Quilt and SurfaceTrim entities that share parts.  In all other cases, this action will return itself and the given part name.

Parameters

part_namesThis parameter is the list of string part names within this entity to get the owner of.  Only strings returned by getPart or getParts should be used for this parameter.

Returns

This action returns a list of lists, where each entry is a list of the DatabaseEntity object representing the entity that owns the given part of this entity, and the part name of the part with respect to the owning entity.

getPartXYZ

$entity getPartXYZ part_name

This action gets the xyz vector for the given part of this entity.  This is only valid for Vertex parts.

Parameters

part_nameThis parameter is the string part name within the entity to get the xyz of.

Returns

This action returns the 3D position of the part as an xyz vector.

getPartXYZs

$entity getPartXYZs part_names

This action gets a list of xyz vectors for the given parts of this entity.  This is only valid for Vertex parts.

Parameters

part_namesThis parameter is a list of string part names within the entity to get the xyzs of.

Returns

This action returns the 3D positions of the parts as a list of xyz vectors.

getPartBoundary

$entity getPartBoundary part_name

This action gets the entity boundary for the given part of this entity.  This is only valid for String, Costring, Edge, and Coedge parts with entities that have boundaries.

Parameters

part_nameThis parameter is the string part name within the entity to get the associated boundary of.

Returns

This action returns a boundary.

getAttributeDictionaryNames

$entity getAttributeDictionaryNames ?-part part? ?-children? ?-attached? ?-class cls?

This action gets a list of string names for the available attribute dictionaries set on this entity.

Parameters

-part partThis optional flag is the string part name within the entity to look for dictionaries.  Only strings returned by getPart should be used for this parameter.
-childrenThis optional flag is the notification to include names of attribute dictionaries set to children of this entity as well.
-attachedThis optional flag is the notification to include names of the attached attribute dictionaries as well.
-class clsThis optional flag is the notification to only include the names of attached attribute dictionaries that have the given class.

Returns

This action returns a list of strings.

getAttributeDictionary

$entity getAttributeDictionary ?-part part? ?-children? ?-attached? ?-class cls? ?-modified? ?-traversed? dict_name ?attr_keys?

This action gets a dictionary of key-value pairs of attributes that have been set on this entity with the given dictionary name.

Parameters

-part partThis optional flag is the string part name within the entity to look for dictionaries.  Only strings returned by getPart should be used for this parameter.
-childrenThis optional flag is the notification to include the attribute dictionary set on children of this entity as well.
-attachedThis optional flag is the notification to include the attached attribute dictionaries as well.
-class clsThis optional flag is the notification to include the first attached attribute dictionary with the given class, rather than it needing to match the dict_name parameter.
-modifiedThis optional flag is the notification to include the modifed state of each key-value pair in the result.  When included, the result will contain an additional list of boolean values that represent the modified state of each pair.
-traversedThis optional flag is the notification to include the DatabaseEntity or AttributeDictionary object where a key value pair was first found in the result.  When included, the result will contain an additional list of the object where the key value pairs were found.
dict_nameThis parameter is the string name of the dictionary.
attr_keysThis optional parameter is a string key or a list of string keys to limit the attributes which should be returned by this action.  If not specified, all existing attributes will be returned by this action.

Returns

This action returns a list of strings that can be converted into a tcl dictionary (list of alternating keys and values).  If the -modified flag was used, an additional list is returned with the modified state of the key value pairs.  If the -traversed flag was used, an additional list is returned with the objects where the key value pairs were found.  The entries of the traversed list will be an AttributeDictionary object, a DatabaseEntity object or a list of DatabaseEntity object string part name.

Information

When using the -children or -attached flags, the dictionary will be a combination of values from multiple dictionaries from different entities, but only the first value found while traversing the children is retained.  The entity or attached dictionary where the value was retained will be returned in the traversedVar variable if given.

setAttributeDictionary

$entity setAttributeDictionary ?-part part? dict_name ?dict?

This action sets a dictionary of key-value pairs on this entity with the given dictionary name.

Parameters

-part partThis optional flag is the string part name within the entity to set the dictionary.  Only strings returned by getPart should be used for this parameter.
dict_nameThis parameter is the string name of the dictionary.
dictThis optional parameter is a list of string values of alternating key-value pairs.  If the parameter is not given, the dictionary will be cleared from the entity.  If the list is an empty list, all key-value pairs of the dictionary will be removed.

Returns

This action returns nothing.

updateAttributeDictionary

$entity updateAttributeDictionary ?-part part? ?-force? dict_name key ?value?

This action updates the attribute dictionary that has been set on this entity with the given name for the given key-value pair.

Parameters

-part partThis optional flag is the string part name within the entity to update the dictionary for.  Only strings returned by getPart should be used for this parameter.
-forceThis optional flag will cause the dictionary and key-value pair to be added if it doesn’t already exist.  The default behavior is to only update the dictionary if the key exists.
dict_nameThis parameter is the string name of the dictionary.
keyThis parameter is a string name of the key to update.
valueThis optional parameter is a string value of a key-value pair to set for the dictionary.  If this parameter is not given, the key will be removed from the dictionary if it exists.  If an empty string is given, it will be assigned to the key.

Returns

This action returns nothing.

renameAttributeDictionary

$entity renameAttributeDictionary ?-part part? dict_name new_dict_name

This action renames an attribute dictionary that has been set on this entity.

Parameters

-part partThis optional flag is the string part name within the entity to rename the dictionary for.  Only strings returned by getPart should be used for this parameter.
dict_nameThis parameter is the string current name of the dictionary to rename.
new_dict_nameThis parameter is the string new name of the dictionary.

Returns

This action returns nothing.

renameAttributeDictionaryKey

$entity renameAttributeDictionaryKey ?-part part? dict_name key new_key

This action renames an attribute dictionary key that has been set on this entity.

Parameters

-part partThis optional flag is the string part name within the entity to update the dictionary key for.  Only strings returned by getPart should be used for this parameter.
dict_nameThis parameter is the string name of the dictionary.
keyThis parameter is a string name of the key to rename.
new_keyThis parameter is a string new key name.

Returns

This action returns nothing.

getAttachedAttributeDictionaries

$entity getAttachedAttributeDictionaries ?-part part?

This action returns a list of pw::AttributeDictionary objects that are attached to this entity.

Parameters

-part partThis optional flag is the string part name within the entity to attach the dictionary to.  Only strings returned by getPart should be used for this parameter.

Returns

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

getAttachedAttributeParts

$entity getAttachedAttributeParts attr_dict

This action returns a list of string part names that are attached to the given <pw::AttributeDicitionary> object.

Parameters

attr_dictThis parameter is the pw::AttributeDictionary object to list the parts that it is attached to.

Returns

This action returns a list of string part names.

attachAttributeDictionary

$entity attachAttributeDictionary ?-part part? ?-exclusiveClass? attr_dict

This action attaches a pw::AttributeDictionary object to this entity.

Parameters

-part partThis optional flag is the string part name within the entity to attach the dictionary to.  Only strings returned by getPart should be used for this parameter.
-exclusiveThis optional flag signals that all other dictionaries that match the class of the given pw::AttributeDictionary will be detached from this entity.
attr_dictThis parameter is the pw::AttributeDictionary object to attach to this entity.

Returns

This action returns nothing.

detachAttributeDictionary

$entity detachAttributeDictionary ?-part part? attr_dict

This action detaches a pw::AttributeDictionary object from this entity.

Parameters

-part partThis optional flag is the string part name within the entity to detach the dictionary from.  Only strings returned by getPart should be used for this parameter.
attr_dictThis parameter is the pw::AttributeDictionary object to detach from this entity.

Returns

This action returns nothing.

getImportedAttribute

$entity getImportedAttribute attribute_name

This action gets the type and value of an entity attribute.

Parameters

attribute_nameThis parameter is the attribute name string.

Returns

This action returns the list {type value}.  The type can be one of Int, String, or Real.

Example

This example shows how to get a named attribute from the existing database entity $db.

Code

set attrName "OUTLET"
if { ![catch {$db getImportedAttribute $attrName} result] } {
    lassign $result attrType attrVal
    puts "$attrType $attrName = '$attrVal'"
} else {
    puts "Attribute not found."
}

Output

"String OUTLET = 'PRESSURE'"

getImportedAttributeNames

$entity getImportedAttributeNames ?-regex? ?pattern?

This action gets the entity’s available attribute names.

Parameters

-regexThis optional flag signifies that the given pattern should be considered a regular expression pattern rather than a glob pattern.
patternThis optional parameter is the string pattern used to filter the returned attribute names.  If a pattern is not given, all attribute names are returned.

Returns

A string list of the attribute names.

Example

This example shows how to get attribute names from the existing database entity $db.

Code

# get all attribute names
puts "all  : [$db getImportedAttributeNames]"

# get attribute names matching glob pattern
puts "glob : [$db getImportedAttributeNames "EX.*"]"

# get attribute names matching the regex pattern "EX.Word.postfix"
# where "Word" must start with a capital letter.
puts "regex: [$db getImportedAttributeNames -regex {EX\.[A-Z]{1}\w+\..+}]"

Output

all  : Attrib1 Attrib2 EX.Mach EX.Node.attr1 EX.Con9.attr EX.1234.attr
glob : EX.Mach EX.Node.attr1 EX.Con9.attr EX.1234.attr
regex: EX.Node.attr1 EX.Con9.attr

getSupportEntities

$entity getSupportEntities

This action gets the entities that this entity requires.

Parameters

This action has no parameters.

Returns

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

Example

This example shows how to get the support entities for $qlt(1).  $qlt(1) is referencing an existing quilt.

Code

foreach ent [$qlt(1) getSupportEntities] {
    puts [$ent getName]
}

Output

TrimSurf-39

getDependentEntities

$entity getDependentEntities

This action gets the entities that require this entity to exist.  Effectively, this returns the list of entities that would be deleted if this entity is deleted.  It is not necessarily the complete set of entities defined in the parameter space if this entity.  Use getReferencingEntities to get all supported entities.

Parameters

This action has no parameters.

Returns

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

Example

This example shows how to get the dependent entities for $qlt(1).  $qlt(1) is referencing an existing quilt.

Code

foreach ent [$qlt(1) getDependentEntities] {
    puts [$ent getName]
}

Output

TrimSurf-39
model-1

getReferencingEntities

$entity getReferencingEntities

This action gets the entities that reference this entity, but not necessarily depend on it to support.

Parameters

This action has no parameters.

Returns

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

Example

This example shows how to get the referencing entities for $curve.  $curve is referencing an existing intersection curve.

Code

foreach ent [$curve getReferencingEntities] {
    puts [$ent getName]
}

Output

surface-1
plane-1

getGridEntities

$entity getGridEntities

This action gets the grid entities that this entity supports.

Parameters

This action has no parameters.

Returns

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

Example

This example shows how to get the grid entities for $qlt(1).  $qlt(1) is referencing an existing quilt.

Code

foreach ent [$qlt(1) getGridEntities] {
    puts [$ent getName]
}

Output

dom-2
pw::DatabaseEntity closestApproach ?-seed seedPt? -result1Var pt1? ?-result2Var pt2? entities1 entities2
This action returns the smallest distance or closest approach between the given database entities.
pw::DatabaseEntity getAdjacentEntities ?-tolerance tol? ?-maximumAngle angle? ?-all? ents
This action returns a list of db entities adjacent to the given entities.
pw::DatabaseEntity getByName ?-path path? name
This action gets a database entity using the name.
pw::DatabaseEntity getBySequence number
This action gets a database entity using the sequence number.
$entity delete ?-force? ?-dependents?
This action deletes this entity.
$entity transform matrix
This action transforms this entity by the given matrix.
$entity closestPoint ?-from fromVar? ?-distance distVar? ?-interval limits? point ?dir?
This action gets the closest point on this entity to the given point or ray.
$entity isDefined
This action checks if this entity is defined.
$entity isParametric
This action checks if this entity is parametric.
$entity isCurve
This action checks if this entity is curve-like.
$entity isSurface
This action checks if this entity is surface-like.
$entity isBaseForProject
This action checks if this entity can be projected onto using a project command.
$entity isBaseForConnector
This action checks if connectors can be built on the entity using the pw::Connector.createOnDatabase command.
pw::Connector createOnDatabase ?-merge tolerance? ?-splitConnectors split_angle? ?-joinConnectors join_angle? ?-parametricConnectors mode? ?-reject rejectVar? ?-type type? entity_or_boundary_list
This action creates new connector objects on the given database entities.
$entity isBaseForDomainStructured
This action checks if domains can be built on the entity using the pw::DomainStructured.createOnDatabase command.
pw::DomainStructured createOnDatabase ?-merge tolerance? ?-splitConnectors split_angle? ?-joinConnectors join_angle? ?-parametricConnectors mode? ?-reject rejectVar? entities
This action creates new structured domain objects on the given database entities.
$entity isBaseForDomainUnstructured
This action checks if domains can be built on the entity using the pw::DomainUnstructured.createOnDatabase command.
pw::DomainUnstructured createOnDatabase ?-merge tolerance? ?-splitConnectors split_angle? ?-joinConnectors join_con_angle? ?-joinDomains join_dom_angle? ?-parametricConnectors mode? ?-reject rejectVar? entities
This creates new unstructured domain objects on the given database entities.
$entity getDescription
This action gets the description of how this entity was defined.
$entity getPartCount part_type
This action gets the number of parts of the entity of a given type.
$entity getPart part_type < index | point | boundary >
This action gets a string representing a part of the entity that can be used to reference the part in other actions.
A string is an array of characters.
$entity getParts ?-filter filter? part_type
This action gets a list of strings representing parts of the entity that can be used to reference the part in other actions.
$entity getPartOwner part_name
This action gets the DatabaseEntity object that owns the given part of this entity and the part name within that entity.
Base type for all database entities
$entity getPartOwners part_names
This action gets a list of the DatabaseEntity object that owns the given parts of this entity and the part name within that entity.
$entity getPartXYZ part_name
This action gets the xyz vector for the given part of this entity.
A vector is a list of float values.
$entity getPartXYZs part_names
This action gets a list of xyz vectors for the given parts of this entity.
$entity getPartBoundary part_name
This action gets the entity boundary for the given part of this entity.
A boundary is reference to either a database curve or the edge of a database surface.
$entity getAttributeDictionaryNames ?-part part? ?-children? ?-attached? ?-class cls?
This action gets a list of string names for the available attribute dictionaries set on this entity.
$entity getAttributeDictionary ?-part part? ?-children? ?-attached? ?-class cls? ?-modified? ?-traversed? dict_name ?attr_keys?
This action gets a dictionary of key-value pairs of attributes that have been set on this entity with the given dictionary name.
$entity setAttributeDictionary ?-part part? dict_name ?dict?
This action sets a dictionary of key-value pairs on this entity with the given dictionary name.
$entity updateAttributeDictionary ?-part part? ?-force? dict_name key ?value?
This action updates the attribute dictionary that has been set on this entity with the given name for the given key-value pair.
$entity renameAttributeDictionary ?-part part? dict_name new_dict_name
This action renames an attribute dictionary that has been set on this entity.
$entity renameAttributeDictionaryKey ?-part part? dict_name key new_key
This action renames an attribute dictionary key that has been set on this entity.
$entity getAttachedAttributeDictionaries ?-part part?
This action returns a list of pw::AttributeDictionary objects that are attached to this entity.
Type for storing a group of key-value pairs that can be attached to entities
$entity getAttachedAttributeParts attr_dict
This action returns a list of string part names that are attached to the given pw::AttributeDicitionary object.
$entity attachAttributeDictionary ?-part part? ?-exclusiveClass? attr_dict
This action attaches a pw::AttributeDictionary object to this entity.
$entity detachAttributeDictionary ?-part part? attr_dict
This action detaches a pw::AttributeDictionary object from this entity.
$entity getImportedAttribute attribute_name
This action gets the type and value of an entity attribute.
$entity getImportedAttributeNames ?-regex? ?pattern?
This action gets the entity’s available attribute names.
$entity getSupportEntities
This action gets the entities that this entity requires.
$entity getDependentEntities
This action gets the entities that require this entity to exist.
$entity getReferencingEntities
This action gets the entities that reference this entity, but not necessarily depend on it to support.
$entity getGridEntities
This action gets the grid entities that this entity supports.
Base type for all glyph types
Entity type
A point is a position either in model space or database parameter space.
A float is a fractional number.
Database curve type
Database surface type
Database model type
Database quilt type
Database trim surface type
Database shell type
Framework type
An integer is a whole number.
pw::Database getAll ?-framework framework? ?-type type_string? ?-enabledOnly? ?-visibleOnly?
This action gets a list of all database entities.
Utility functions for transform matrices, which are represented as a list of sixteen real values.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
pw::Entity project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?-fit tolerance? ?<-interior | -shape>? entities ?dbentities?
This action projects the given entities onto database entities.
pw::GridEntity project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?-fit tolerance? ?<-interior | -shape>? entities ?dbentities?
This action projects grid entities onto database entities.
$curve project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?-fit tolerance? ?-interior? ?dbentities?
This action projects this curve onto one or more database entities.
$con project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?-fit tolerance? ?<-interior | -shape>? ?dbentities?
This action projects this connector onto one or more database entities.
Base type for all grid entities.
Close