import_dxf#
- Icepak.import_dxf(file_path: str, layers: list, auto_detect_close: bool = True, self_stitch: bool = True, self_stitch_tolerance: float = 0, scale: float = 0.001, defeature_geometry: bool = False, defeature_distance: float = 0, round_coordinates: bool = False, round_num_digits: int = 4, write_poly_with_width_as_filled_poly: bool = False, import_method: int = 1) bool [source]#
Import a DXF file.
- Parameters:
- file_path
str
Path to the DXF file.
- layers
list
List of layer names to import. To get the dxf_layers in the DXF file, you can call the
get_dxf_layers
method.- auto_detect_closebool,
optional
Whether to check polylines to see if they are closed. The default is
True
. If a polyline is closed, the modeler creates a polygon in the design.- self_stitchbool,
optional
Whether to join multiple straight line segments to form polylines. The default is
True
.- self_stitch_tolerance
float
,optional
Self stitch tolerance value. The default is
0
.- scale
float
,optional
Scaling factor. The default is
0.001
. The units aremm
.- defeature_geometrybool,
optional
Whether to defeature the geometry to reduce complexity. The default is
False
.- defeature_distance
float
,optional
Defeature tolerance distance. The default is
0
.- round_coordinatesbool,
optional
Whether to rounds all imported data to the number of decimal points specified by the next parameter. The default is
False
.- round_num_digits
int
,optional
Number of digits to which to round all imported data. The default is
4
.- write_poly_with_width_as_filled_polybool,
optional
Imports wide polylines as polygons. The default is
False
.- import_method
int
, bool Whether the import method is
Script
orAcis
. The default is1
, which means that theAcis
is used.- sheet_bodies_2dbool,
optional
Whether importing as 2D sheet bodies causes imported objects to be organized in terms of 2D sheets. The default is
True
.
- file_path
- Returns:
- bool
True
when successful,False
when failed.
References
>>> oEditor.ImportDXF