コード例 #1
0
ファイル: insert.py プロジェクト: jrflack/ezdxf
    def explode(self,
                target_layout: 'BaseLayout' = None,
                non_uniform_scaling=False) -> 'EntityQuery':
        """
        Explode block reference entities into target layout, if target layout is ``None``, the target layout is the
        layout of the block reference.

        Transforms the block entities into the required :ref:`WCS` location by applying the block reference
        attributes `insert`, `extrusion`, `rotation` and the scaling values `xscale`, `yscale` and `zscale`.
        Multiple inserts by row and column attributes is not supported.

        Returns an :class:`~ezdxf.query.EntityQuery` container with all "exploded" DXF entities.

        .. warning::

            **Non uniform scaling** lead to incorrect results for text entities (TEXT, MTEXT, ATTRIB) and
            some other entities like ELLIPSE, SHAPE, HATCH with arc or ellipse path segments and and
            POLYLINE/LWPOLYLINE with arc segments.

        Args:
            target_layout: target layout for exploded entities
            non_uniform_scaling: enable non uniform scaling if ``True``, see warning

        .. versionadded:: 0.11.2
            experimental feature

        """
        if target_layout is None:
            target_layout = self.get_layout()

        if non_uniform_scaling is False and not self.has_uniform_scaling:
            return EntityQuery()

        return explode_block_reference(self, target_layout=target_layout)
コード例 #2
0
ファイル: insert.py プロジェクト: Rahulghuge94/ezdxf
    def explode(self, target_layout: "BaseLayout" = None) -> "EntityQuery":
        """Explode block reference entities into target layout, if target
        layout is ``None``, the target layout is the layout of the block
        reference. This method destroys the source block reference entity.

        Transforms the block entities into the required :ref:`WCS` location by
        applying the block reference attributes `insert`, `extrusion`,
        `rotation` and the scaling values `xscale`, `yscale` and `zscale`.

        Attached ATTRIB entities are converted to TEXT entities, this is the
        behavior of the BURST command of the AutoCAD Express Tools.

        Returns an :class:`~ezdxf.query.EntityQuery` container with all
        "exploded" DXF entities.

        .. warning::

            **Non uniform scaling** may lead to incorrect results for text
            entities (TEXT, MTEXT, ATTRIB) and maybe some other entities.

        Args:
            target_layout: target layout for exploded entities, ``None`` for
                same layout as source entity.

        """
        if target_layout is None:
            target_layout = self.get_layout()
            if target_layout is None:
                raise DXFStructureError(
                    "INSERT without layout assignment, specify target layout.")
        return explode_block_reference(self, target_layout=target_layout)
コード例 #3
0
    def explode(self,
                target_layout: 'BaseLayout' = None,
                non_uniform_scaling=None) -> 'EntityQuery':
        """
        Explode block reference entities into target layout, if target layout is
        ``None``, the target layout is the layout of the block reference.

        Transforms the block entities into the required :ref:`WCS` location by
        applying the block reference attributes `insert`, `extrusion`,
        `rotation` and the scaling values `xscale`, `yscale` and `zscale`.
        Multiple inserts by row and column attributes is not supported.

        Attached ATTRIB entities are converted to TEXT entities, this is the
        behavior of the BURST command of the AutoCAD Express Tools.

        Returns an :class:`~ezdxf.query.EntityQuery` container with all
        "exploded" DXF entities.

        .. warning::

            **Non uniform scaling** may lead to incorrect results for text
            entities (TEXT, MTEXT, ATTRIB) and some other entities like HATCH
            with arc or ellipse path segments.

        Args:
            target_layout: target layout for exploded entities, ``None`` for
            same layout as source entity.

        .. versionchanged:: 0.13
            deprecated `non_uniform_scaling` argument

        """
        if target_layout is None:
            target_layout = self.get_layout()
            if target_layout is None:
                raise DXFStructureError(
                    'INSERT without layout assigment, specify target layout.')
        if non_uniform_scaling is not None:
            warnings.warn(
                'Insert.explode() argument `non_uniform_scaling` is deprecated'
                ' (removed in v0.15).', DeprecationWarning)
        return explode_block_reference(self, target_layout=target_layout)
コード例 #4
0
ファイル: insert.py プロジェクト: vshu3000/ezdxf
    def explode(self,
                target_layout: 'BaseLayout' = None,
                non_uniform_scaling=False) -> 'EntityQuery':
        """
        Explode block reference entities into target layout, if target layout is ``None``, the target layout is the
        layout of the block reference.

        Transforms the block entities into the required :ref:`WCS` location by applying the block reference
        attributes `insert`, `extrusion`, `rotation` and the scaling values `xscale`, `yscale` and `zscale`.
        Multiple inserts by row and column attributes is not supported.

        Attached ATTRIB entities are converted to TEXT entities, this is the behavior of the BURST command of
        the AutoCAD Express Tools.

        Returns an :class:`~ezdxf.query.EntityQuery` container with all "exploded" DXF entities.

        .. warning::

            **Non uniform scaling** lead to incorrect results for text entities (TEXT, MTEXT, ATTRIB) and
            some other entities like ELLIPSE, SHAPE, HATCH with arc or ellipse path segments and and
            POLYLINE/LWPOLYLINE with arc segments. Non uniform scaling is getting better, but still not perfect!

        Args:
            target_layout: target layout for exploded entities, ``None`` for same layout as source entity.
            non_uniform_scaling: enable non uniform scaling if ``True``, see warning

        .. versionadded:: 0.12
            experimental feature

        """
        if target_layout is None:
            target_layout = self.get_layout()
            if target_layout is None:
                raise DXFStructureError(
                    'INSERT without layout assigment, specify target layout.')

        if non_uniform_scaling is False and not self.has_uniform_scaling:
            return EntityQuery()

        return explode_block_reference(self, target_layout=target_layout)