write_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxf (Operator)

Name

write_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxf — Write XLD contours to a file in DXF format.

Signature

write_contour_xld_dxf(Contours : : FileName : )

Herror write_contour_xld_dxf(const Hobject Contours, const char* FileName)

Herror T_write_contour_xld_dxf(const Hobject Contours, const Htuple FileName)

void WriteContourXldDxf(const HObject& Contours, const HTuple& FileName)

void HXLDCont::WriteContourXldDxf(const HString& FileName) const

void HXLDCont::WriteContourXldDxf(const char* FileName) const

void HXLDCont::WriteContourXldDxf(const wchar_t* FileName) const   (Windows only)

static void HOperatorSet.WriteContourXldDxf(HObject contours, HTuple fileName)

void HXLDCont.WriteContourXldDxf(string fileName)

Description

write_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxfWriteContourXldDxf writes the XLD contours ContoursContoursContoursContourscontours to the file FileNameFileNameFileNameFileNamefileName in DXF format. If no absolute path is given in FileNameFileNameFileNameFileNamefileName the output file is created in the current directory of the HALCON process.

Besides the geometry of the ContoursContoursContoursContourscontours, all attributes and global attributes that are defined for the ContoursContoursContoursContourscontours are written to the file.

write_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxfWriteContourXldDxf writes the file according to the DXF version AC1009 (AutoCAD Release 12). Each contour is stored as a POLYLINE. The attribute values are stored as extended data of each VERTEX of the POLYLINE. The global attribute values are stored as extended data of the POLYLINE. All attribute names are also stored as extended data of the POLYLINE.

The operator read_contour_xld_dxfread_contour_xld_dxfReadContourXldDxfReadContourXldDxfReadContourXldDxf can be used to read the XLD contours together with their attributes.

Other applications that are able to read DXF files only import the contour geometry, but they ignore the attribute information.

Description of the format of the extended data

Each block of extended data starts with the following DXF group:

1001 HALCON

The attributes are written in the following format as extended data of each VERTEX:

DXF Explanation
1000 Meaning
contour attributes
1002 Beginning of the value list
{
1070 Number of attributes (here: 3)
3
1040 Value of the first attribute
5.00434303
1040 Value of the second attribute
126.8638916
1040 Value of the third attribute
4.99164152
1002 End of the value list
}

The global attributes are written in the following format as extended data of each POLYLINE:

DXF Explanation
1000 Meaning
global contour attributes
1002 Beginning of the value list
{
1070 Number of global attributes (here: 5)
5
1040 Value of the first global attribute
0.77951831
1040 Value of the second global attribute
0.62637949
1040 Value of the third global attribute
103.94314575
1040 Value of the fourth global attribute
0.21434096
1040 Value of the fifth global attribute
0.21921949
1002 End of the value list
}

The names of the attributes are written in the following format as extended data of each POLYLINE:

DXF Explanation
1000 Meaning
names of contour attributes
1002 Beginning of the value list
{
1070 Number of attribute names (here: 3)
3
1000 Name of the first attribute
angle
1000 Name of the second attribute
response
1000 Name of the third attribute
edge_direction
1002 End of the value list
}

The names of the global attributes are written in the following format as extended data of each POLYLINE:

DXF Explanation
1000 Meaning
names of global contour attributes
1002 Beginning of the value list
{
1070 Number of global attribute names (here: 5)
5
1000 Name of the first global attribute
regr_norm_row
1000 Name of the second global attribute
regr_norm_col
1000 Name of the third global attribute
regr_dist
1000 Name of the fourth global attribute
regr_mean_dist
1000 Name of the fifth global attribute
regr_dev_dist
1002 End of the value list
}

Execution Information

Parameters

ContoursContoursContoursContourscontours (input_object)  xld_cont(-array) objectHXLDContHXLDContHobject

XLD contours to be written.

FileNameFileNameFileNameFileNamefileName (input_control)  filename.write HTupleHTupleHtuple (string) (string) (HString) (char*)

Name of the DXF file.

File extension: .dxf

Result

If the parameters are correct and the file could be written the operator write_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxfWriteContourXldDxf returns the value 2 (H_MSG_TRUE). Otherwise, an exception is raised.

Possible Predecessors

edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPix

See also

read_contour_xld_dxfread_contour_xld_dxfReadContourXldDxfReadContourXldDxfReadContourXldDxf, write_polygon_xld_dxfwrite_polygon_xld_dxfWritePolygonXldDxfWritePolygonXldDxfWritePolygonXldDxf, query_contour_attribs_xldquery_contour_attribs_xldQueryContourAttribsXldQueryContourAttribsXldQueryContourAttribsXld, query_contour_global_attribs_xldquery_contour_global_attribs_xldQueryContourGlobalAttribsXldQueryContourGlobalAttribsXldQueryContourGlobalAttribsXld, get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXldGetContourAttribXld, get_contour_global_attrib_xldget_contour_global_attrib_xldGetContourGlobalAttribXldGetContourGlobalAttribXldGetContourGlobalAttribXld

Module

Foundation