write_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxfwrite_contour_xld_dxf (Operator)

Name

write_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxfwrite_contour_xld_dxf — 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)

def write_contour_xld_dxf(contours: HObject, file_name: str) -> None

Description

write_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxfWriteContourXldDxfwrite_contour_xld_dxf writes the XLD contours ContoursContoursContoursContourscontourscontours to the file FileNameFileNameFileNameFileNamefileNamefile_name in DXF format. If no absolute path is given in FileNameFileNameFileNameFileNamefileNamefile_name the output file is created in the current directory of the HALCON process.

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

write_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxfWriteContourXldDxfwrite_contour_xld_dxf 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_dxfReadContourXldDxfReadContourXldDxfReadContourXldDxfread_contour_xld_dxf 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

ContoursContoursContoursContourscontourscontours (input_object)  xld_cont(-array) objectHXLDContHObjectHXLDContHobject

XLD contours to be written.

FileNameFileNameFileNameFileNamefileNamefile_name (input_control)  filename.write HTuplestrHTupleHtuple (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_dxfWriteContourXldDxfWriteContourXldDxfWriteContourXldDxfwrite_contour_xld_dxf returns the value 2 (H_MSG_TRUE). Otherwise, an exception is raised.

Possible Predecessors

edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix

See also

read_contour_xld_dxfread_contour_xld_dxfReadContourXldDxfReadContourXldDxfReadContourXldDxfread_contour_xld_dxf, write_polygon_xld_dxfwrite_polygon_xld_dxfWritePolygonXldDxfWritePolygonXldDxfWritePolygonXldDxfwrite_polygon_xld_dxf, query_contour_attribs_xldquery_contour_attribs_xldQueryContourAttribsXldQueryContourAttribsXldQueryContourAttribsXldquery_contour_attribs_xld, query_contour_global_attribs_xldquery_contour_global_attribs_xldQueryContourGlobalAttribsXldQueryContourGlobalAttribsXldQueryContourGlobalAttribsXldquery_contour_global_attribs_xld, get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXldGetContourAttribXldget_contour_attrib_xld, get_contour_global_attrib_xldget_contour_global_attrib_xldGetContourGlobalAttribXldGetContourGlobalAttribXldGetContourGlobalAttribXldget_contour_global_attrib_xld

Module

Foundation