Navigation: CADSiteTools-Reports > Report Template Explorer > Node settings >

Entity relationships

 

 

 

 

 

If an entity is related to another by a spatial constraint, relationships between parent and child entities can be specified in this section. For example, if a closed polyline has a text annotation inside, it is possible to define that the related child entity (text) insertion point must be inside the parent entity (polyline). Information about the related entity is saved in the parent entity extended data dictionary (XDictionary) under the dictionary name 'CSTE_Relationships'.  The properties from the related child entity can be found in this dictionary and linked to spreadsheet cells. This way it is possible to include in the report information about the parent entity (polyline) such as area and information about the corresponding related child entity (text).

 

Related topics:

 

Entity relationships report video

 

How to add a entity relationship:

 

1.      Right click in the 'Entity relationships' node.

2.      Select 'Define an entity relationship' from the context menu.

 

3.      Select a drawing entity that will be the parent entity.

4.      Select a drawing entity that will be the related child entity.

 

 

After defining an entity relationship, the following nodes will be created:

 

 

1.      Parent entity node. The default name for this node is the name of the selected entity followed by a consecutive number between parenthesis. This name can be edited by selecting the node and then left clicking on it to activate the text editing mode.

2.      Filter properties. Parent and child entities can be filtered by defining filter properties , values and relational operators,  optionally using logical operators. If no filter properties are specified all the drawing entities from the main selection set will be processed. The default filter property is the name of the selected entity, using the relational operator '=' (equal).

3.      Related child entities.  In this section all the entities related to the parent entity are found. New related child entities can be added by right clicking on this node and selecting 'Add related child entity' from the context menu.

4.      Child entity node. Selecting this node the relationship parameter constraints between parent and child entity can be defined. The default name for this node is the name of the selected entity followed by a consecutive number between parenthesis starting at 1. This name can be edited by selecting the node and then left clicking on it to activate the text editing mode.

 


Parent entity node settings.

 

Selecting the parent entity node, the following dialog box is shown:

 

 

1.      Process parent-child entity relationships before creating report. If the relationship conditions between parent and child entities do not change this option can be unchecked after creating the report for the first time. This way, the previous information saved in parent and child entities will be used instead of being recalculated every time the report is created, considerably reducing processing time.

 


Child Entity node settings

 

Selecting the child entity node, the following dialog box is shown:

 

 

1.      Relationship name. Used to identify the relationship between the child entity and the parent entity.

2.      Description. Optional text to describe the relationship between the child entity and the parent entity in more detail.

3.      Child entity reference. The property to take as a reference. The list of available child entity references is determined by the type of drawing entity selected, and can be the entity itself,  the entity bounding box, or the list of entity point properties such as insertion point, center point, start point, etc.

4.      Relational condition. The child entity reference specified must meet the selected condition to be accepted as a valid child related entity.

5.      Parameter. If  a parameter point property is selected as a relational condition, a value can be specified in this section. Parameter values can be between 0 (start point) and 1 (end point).

6.      Select only the first valid child entity found. If  this option is not checked and more than one child entity meet the relational condition criteria they will all be saved in the parent entity extended dictionary (XDictionary) under the relationship name key. If this option is not checked only the first valid child entity will be saved.

 


Child entity references.

 

An entity is considered a curve if is of the following types or derived from them:

 

·         Light weight polyline

·         Heavy polyline

·         3D Polyline

·         Arc

·         Circle

·         Ellipse

·         Leader

·         Line

·         Ray

·         Spline

·         Xline

 

A parameter point reference can be selected if the child entity is a curve. Parameter values can range from 0 (start point) to 1 (end point). The following parameter points where inserted in a polyline:

 

 

1.      Parameter value = 0 (start point)

2.      Parameter value = 0.5 (middle point)

3.      Parameter value = 1 (end point)

 

 

An entity bounding box wraps the entity extents, and has the following reference points:

 

1.      Bounding box upper left point

2.      Bounding box upper center point

3.      Bounding box upper right point

4.      Bounding box middle left point

5.      Bounding box center point

6.      Bounding box middle right point

7.      Bounding box lower left point

8.      Bounding box lower center point

9.      Bounding box lower right point

 

 

Depending on the related child entity type the reference properties available change. The following table describes the available child entity references according to the child entity type:

 

Child entity reference

Entity type

Entity itself

Curve

Bounding box

Bounding box upper left point

Bounding box upper center point

Bounding box upper right point

Bounding box middle left point

Bounding box center point

Bounding box middle right point

Bounding box lower left point

Bounding box lower center point

Bounding box lower right point

 

Any entity type

Parameter point

Curve

Point property

Any entity that has point properties such as insertion point, start point, end point, etc.

 


Relational conditions

 

The following table describes the available relational conditions according to the child entity reference property selected:

 

Child entity reference

Relational condition

Child entity type

Parent entity type

 

 

Entity itself

 

 

 

 

Child entity inside parent entity.

Curve

Closed curve

Parent entity inside child entity.

Closed curve

Curve

Intersects with parent entity.

Curve

Curve

Child entity inside or intersects parent entity.

Curve

Closed curve

Parent entity inside or intersects child entity.

Closed curve

Curve

 

 

 

 

 

Bounding box

 

 

 

 

 

Child entity bounding box inside parent entity bounding box.

Any entity type

Any entity type

Parent entity bounding box inside child entity bounding box.

Any entity type

Any entity type

Child entity bounding box intersects parent entity bounding box.

Any entity type

Any entity type

Parent entity bounding box intersects child entity bounding box.

Any entity type

Any entity type

Child entity bounding box intersects or inside parent entity bounding box.

Any entity type

Any entity type

Parent entity bounding box intersects or inside child entity bounding box.

Any entity type

Any entity type

 

 

 

Point property

 

 

 

Distance to parent entity:*

Any entity type that has the referenced point property.

Curve

Distance and angle to parent entity:*

Any entity type that has the referenced point property.

Curve

Angle to parent entity:*

Any entity type that has the referenced point property.

Curve

Point inside parent entity.

Any entity type that has the referenced point property.

Closed curve

 


Parent entity properties table

 

*The following table describes the available parent entity properties if the child entity reference is a point property and the relational condition selected is a distance and/or angle to a parent entity property:

 

Parent entity property

Parent entity type

Comments

Bounding box center point

Bounding box upper left point

Bounding box upper center point

Bounding box upper right point

Bounding box middle right point

Bounding box lower right point

Bounding box lower center point

Bounding box lower left point Bounding box middle left point

Any entity type

Please see the entity bounding box description.

Closest point

Curve

 

Start point

Curve

 

End Point

Curve

 

Middle Point

Curve

 

Parameter point

Curve

Parameter value between 0 an 1 must be specified.

Closest vertex

Heavy polyline

A vertex entity is returned instead of the polyline entity.

Closest segment

Heavy polyline

A vertex entity is returned instead of the polyline entity.

Closest parameter point on segment

Heavy polyline

A vertex entity is returned instead of the polyline entity.

Closest center point

Heavy polyline

The first valid vertex of a curved segment is returned.

Point property

Any entity type that has the referenced point property.

 

 


Angle parameters

 

If the child entity reference is a point property and the relational condition selected is an angle to a parent entity property, the angle parameters section is shown :

 

1.      Angle to:  The available parent properties are listed according to the parent entity type. Please see the parent entity properties table for a detailed description of available properties.

2.      Angle:  A numeric value can be entered to specify the angle between the child entity point and the parent entity point reference. The angle can also be specified selecting the button to the right inside this box and picking two points on screen.

3.      Degrees. When this option is checked, decimal degrees will be considered, otherwise the angle will be considered to be in radians

4.      Parameter. If the parent property selected is a parameter point, a parameter value between 0 (start) and 1 (end) can be specified.

 


Distance parameters

 

If the child entity reference is a point property and the relational condition selected a distance to a parent entity property, the distance parameters section is shown :

 

 

1.      Distance to:  The available parent properties are listed according to the parent entity type. Please see the parent entity properties table for a detailed description of available properties.

2.      Distance:  A numeric value can be entered to specify the distance between the child entity point and the parent entity point reference. The distance can also be specified selecting the button to the right inside this box and picking two points on screen.

3.      2d distance. When this option is checked, points will be considered with zero elevation (Z=0), otherwise point elevation will be considered.

4.      Tolerance. The calculated distance between parent and child reference points will be considered valid if it falls between the distance specified plus/minus this value. For example, if the distance specified is 10 and the tolerance value specified is 0.5, valid distances will be between 9.5 and 10.5.

5.      Parameter. If the parent property selected is a parameter point, a parameter value between 0 (start) and 1 (end) can be specified.

 


Processing entity relationships

 

After defining entity relationships between child entities and the corresponding relational conditions to parent entities, entity relationships can be processed. After processing, the information about each related child entity will be saved in the correspondent parent entity extended dictionary. The properties of related child entities can be selected in the parent entity extended dictionary (XDictionary) under the 'CSTE_Relationships' key.

 

How to process entity relationships

 

1.      Right click in the 'Entity relationships' node.

2.      Select "Process entity relationships' from the context menu.

 

3.      Select the drawing entities on the screen that will be processed.

 

How to link related child entity properties to spreadsheet cells after processing entity relationships

 

1.      Right click in the 'Entity properties' node where the child entity property will be linked.

2.      Select 'Add entity property from drawing' from the context menu.

 

3.      Select any parent entity that has been processed to detect related child entities.

4.      In the Entity Properties Explorer expand the XDictionary property node at the bottom of the properties list.

5.      Expand the 'CSTE_Relationships' node.

6.      Expand the 'XDictionary' child node.

7.      Select the node that has the name of the relationship processed.

8.      Select the node DXF330. This is the node that has the information about the related child entity.

9.      Select the desired child entity property from the list.

10.   Select the cell where the property will be linked in the Report Template Editor spreadsheet.

11.   Select the OK button in the 'Select cell range address' dialog box.

 


 

1.      XDictionary node of the parent entity selected.

2.      CSTE_Relationships node, where all the information about related child entities is found.

3.      Relationship node with the same name as the relationship processed. The relationship description can be found in the DXF1 node in this  section.

4.      DXF330 node where the properties of child entities are found. If the 'Select only the first valid child entity found' was not checked, there can be more than one DXF330 node.

5.      Available child entity properties that can be selected (blue color).

 

 

Tip: After processing entity relationships the number of valid and invalid relationships found will be displayed at the AutoCAD command line.

 

Tip: After processing entity relationships you can select the 'Entity Properties Explorer' from the Report Template Editor toolbar menu () and pick a processed parent entity to see if the related child entities were correctly detected.

 

Tip: If the relationship conditions between parent and child entities do not change the 'Process parent-child entity relationships before creating report' in the parent entity node settings can be unchecked after creating the report for the first time. This way, the previous information saved in parent and child entities will be used instead of being recalculated every time the report is created, considerably reducing processing time.

 

Tip: Heavy polylines can save information in each one of its vertices. You can convert a regular light weight polyline to heavy polyline using the CONVERTPOLY AutoCAD command. Also, you can set the AutoCAD PLINETYPE variable to 0 (zero) to draw heavy polylines instead of light weight polylines.

 

 

 

 

 


Copyright © 2003-2012 CadSite Software

http://www.cadsitetools.com