In the factual data set under that graphical elements of some drawings, elements of type 37 appear visually identical to text elements. However, they are defined by a drawing and summarized in property records in groups. In a drawing, any number of such properties can give factual data definitions. When property data is then placed, they can be associatively placed. This means that they will be linked together with another member. Non-associatively placed attribute data is often found in cell libraries. If a cell is placed with free factual data from a cell library, the property data is then subsequently linked to the cell. The technical data corresponds to the attributes of an AutoCAD block. Being linked due to the limitations in the DWG format, this DWG only can with blocks (shared cells). In this example, we will look at areas to define tangible data that we want to use in a title block to create a new model and define records with factual data.It will look something like this:
The title block is indicated only by a few lines. The property data is represented with names in the drawing and were not placed associatively, because otherwise they would display the value.
Next, we will create a drawing and place the cell within the drawing. The attribute data is currently empty and must be filled with the values of this drawing with the command "edit attribute data" shown circled below:
To search the attribute data in a drawing, can can apply several different strategies. We have defined the first parts selection sets, where certain pre-selected items or certain types of items were filled.When looking for factual data, we can also go this way, but we should consider in advance how we will need the technical data that is found.
First of all, I would like to search for a very specific kind of date, which may only be present in the drawing when the cell is placed with the title block with the example property data called "project". In my example, I have entered the following data, so I can search to obtain the result value "BE Community".
This example search would look something like this:
Sub elementinfo() Dim ele As TagElement Dim ee As ElementEnumerator Dim header, line As String Dim file As String Dim Sc As New ElementScanCriteria Sc.ExcludeAllTypes Sc.IncludeType msdElementTypeTag If ActiveWorkspace.IsConfigurationVariableDefined("MyOutputFile") Then file = ActiveWorkspace.ConfigurationVariableValue("MyOutputFile") Else MsgBox "The Variable MyOutputFile is undefined. Stopped processing.", vbCritical Exit Sub End If Open file For Append As #1 Set ee = ActiveModelReference.GraphicalElementCache.Scan(Sc) Do While ee.MoveNext Set ele = ee.Current.AsTagElement If ele.TagDefinitionName = "Project" Then Print #1, "Project" & ";" & ele.Value End If Loop Close #1 End Sub
As a result, I find the last line of the .csv:
The search was successful, so we have only one property date with the value "BE Community" found.
This type of search is not only for reading out certain factual data, but also can serve as a check on the correctness of drawings. This test could also be made to test the presence of the drawing header, to check that the drawing is complete.
A material date is characterized by the following 3 characteristics: the value .Value, the name of the property date .TagDefinitionName, and the attribute data set .TagSetName.
The previous method to search for attribute data does not include the identity of the data, but often attribute data goes together, such as the technical data of a drawing header. It may be easier to look for the attribute data according to the elements rather than the factual data.
Here is an example on how to read out the attribute data of the title block by searching the cell and then reading attribute data:
Sub elementinfo() Dim ele As CellElement Dim ee As ElementEnumerator Dim header, line As String Dim file As String Dim oTags() As TagElement Dim Sc As New ElementScanCriteria Sc.ExcludeAllTypes Sc.IncludeOnlyCell ("Default") Sc.IncludeType msdElementTypeCellHeader If ActiveWorkspace.IsConfigurationVariableDefined("MyOutputFile") Then file = ActiveWorkspace.ConfigurationVariableValue("MyOutputFile") Else MsgBox "The Variable MyOutputFile is undefined. Stopped processing.", vbCritical Exit Sub End If Open file For Append As #1 Set ee = ActiveModelReference.Scan(Sc) Do While ee.MoveNext Set ele = ee.Current.AsCellElement If ele.HasAnyTags Then Print #1, "Cell: " & ";" & ele.Name oTags = ele.GetTags For i = LBound(oTags) To UBound(oTags) line = oTags(i).TagSetName & ";" & oTags(i).TagDefinitionName line = line & ";" & oTags(i).Value Print #1, line Next End If Loop Close #1 End Sub
This routine output the following from my example:
The issue of the name of property date may seem initially unnecessary, but in the general case, a larger number may be attached to property records and only the combination of a record name and definition name is unique, because this combination can only attach once to an item in a cell.
<< RETURN TO PART 9 <<