
    h*o                       S SK Jr  S SKJrJrJrJrJrJrJ	r	  S SK
Jr  S SKrS SKrS SKJr  S SKJrJrJrJrJrJrJr  S SKJrJrJrJrJr  S SKJrJ r J!r!J"r"J#r#J$r$J%r%J&r&  S S	K'J(r(J)r)  S S
K*J+r+J,r,  S SK-J.r.  S SK/J0r0  S SK1J2r2  SSK3J4r4J5r5  SSK6J7r7J8r8J9r9J:r:  SSK;J<r<  SSK=J>r>  \(       a$  S SK1J?r?  S SK-J@r@JArAJBrB  S SKCJDrDJErE  S SKFJGrG  S SKHJIrI  S/rJ\R                  " S5      rLSrM\" S\" SS SS9\" S\R                  S9\" S \R                  S!9\" S"S SS9\" S#SS\R                  \S$9\" S%SS\R                  \S$9\" S&SS\R                  \S$9\" S'S SS9\" S(SS\R                  \S$9\" S)SS\R                  \S$9\" S*S SS9\" S+S SS9\" S,\R                  \#S\R                  \S-9S..5      rT\" \T5      rU\" \:\U5      rV\.R                   " S/ S\<5      5       rXg)0    )annotations)TYPE_CHECKINGIterableIteratorcastUnionOptionalCallable)SelfN)	validator)DXFAttrDXFAttributesDefSubclassXTypeRETURN_DEFAULTgroup_code_mappingmerge_group_code_mappings)DXF12SUBCLASS_MARKERDXFValueErrorDXFKeyErrorDXFStructureError)Vec3UVecX_AXISY_AXISZ_AXISMatrix44UCSNULLVEC)InsertTransformationErrorInsertCoordinateSystem)explode_block_reference virtual_block_reference_entities)factory)EntityQuery)
AuditError   )
base_classSubclassProcessor)
DXFGraphicacdb_entityelevation_to_z_axisacdb_entity_group_codes)LinkedEntities)Attrib)Auditor)DXFNamespaceAttDef	DXFEntity)
BaseLayoutBlockLayout)AbstractTagWriter)xrefInsertezdxfg&.>AcDbBlockReferenceB   T)defaultoptional   
   )xtype&   )   )r=   r>   r   fixer*   +   2   F   G   ,   -      )rA   r=   r>   r   rD   )attribs_follownameinsert	elevationxscaleyscalezscalerotationcolumn_count	row_countcolumn_spacingrow_spacing	extrusionc                  l  ^  \ rS rSrSrSr\" \\\	5      r
\S*S j5       r\S+S j5       r S,   S-U 4S jjjrS.U 4S jjrS/U 4S	 jjrS0U 4S
 jjrS1U 4S jjr\S+S j5       r\S+S j5       rS2S jrS3S jrS+S jr   S4       S5S jjr S6     S7S jjr S8     S9S jjr S:       S;S jjrS8S<S jjr S=       S>S jjrS8S?S jjrS@S jrSAS jr SBS jr!SCS jr"S r#S@S jr$ S,SS.   SDS  jjjr%SES! jr&SSS".   SFS# jjr'\SGS$ j5       r(SHS% jr)SIS& jr*SJU 4S' jjr+SKS( jr,S)r-U =r.$ )Lr9      a(  DXF INSERT entity

The INSERT entity is hard owner of its ATTRIB entities and the SEQEND entity:

    ATTRIB.dxf.owner == INSERT.dxf.handle
    SEQEND.dxf.owner == INSERT.dxf.handle

Note:

    The ATTDEF entity in block definitions is owned by the BLOCK_RECORD like
    all graphical entities.

INSERTc                    U R                   $ N_sub_entitiesselfs    G/var/www/html/env/lib/python3.13/site-packages/ezdxf/entities/insert.pyattribsInsert.attribs   s    !!!    c                >    [        [        U R                  5      5      $ r^   )boollenrd   ra   s    rc   rM   Insert.attribs_follow   s    C%&&rf   Nc                   > [         [        U ]  U5      nU(       a3  UR                  U[        5        UR
                  (       a  [        US5        U$ )z!Loading interface. (internal API))rO   )superr+   load_dxf_attribssimple_dxfattribs_loadermerged_insert_group_codesr12r-   )rb   	processordxf	__class__s      rc   rm   Insert.load_dxf_attribs   s@    
 J6yA..s4MN}}#C5
rf   c                  > [         TU ]  U5        UR                  [        :  aa  U R                  R
                  S:  d  U R                  R                  S:  a  UR                  [        S5        OUR                  [        S5        U R                  (       a  UR                  SS5        U R                  R                  U/ SQ5        g)z(Export entity specific data as DXF tags.r(   AcDbMInsertBlockr;   r<   )rN   rO   rQ   rR   rS   rT   rU   rV   rW   rX   rY   N)rl   export_entity
dxfversionr   rr   rU   rV   
write_tag2r   rM   export_dxf_attribsrb   	tagwriterrs   s     rc   rw   Insert.export_entity   s    i(%'%%)txx/A/AA/E$$_6HI$$_6JK  Q'##	
rf   c                t   >^ [         TU ]  T5        U R                  (       a  U R                  U4S j5        g g )Nc                &   > U R                  T5      $ r^   )
export_dxf)er|   s    rc   <lambda>#Insert.export_dxf.<locals>.<lambda>   s    Y0Grf   )rl   r   rM   process_sub_entitiesr{   s    `rc   r   Insert.export_dxf   s-    9%%%&GH rf   c                n   > [         TU ]  U5        UR                  U R                  R                  5        g r^   )rl   register_resourcesadd_block_namerr   rN   )rb   registryrs   s     rc   r   Insert.register_resources   s&    "8,.rf   c                   > [         TU ]  X5        UR                  U R                  R                  5      UR                  l        g r^   )rl   map_resourcesget_block_namerr   rN   )rb   clonemappingrs   s      rc   r   Insert.map_resources   s.    e- //>		rf   c                f   U R                   R                  S5      (       a  U R                   R                  S:w  a  gU R                   R                  S5      (       a  U R                   R                  S:w  a  gU R                   R                  S5      (       a  U R                   R                  S:w  a  gg)z3Returns ``True`` if scaling is applied to any axis.rQ   r(   TrR   rS   F)rr   hasattrrQ   rR   rS   ra   s    rc   has_scalingInsert.has_scaling   s|     88H%%$((//Q*>88H%%$((//Q*>88H%%$((//Q*>rf   c                    [        U R                  R                  5      [        U R                  R                  5      s=:H  =(       a"    [        U R                  R                  5      :H  $ s  $ )zReturns ``True`` if the scale factor is uniform for x-, y- and z-axis,
ignoring reflections e.g. (1, 1, -1) is uniform scaling.

)absrr   rQ   rR   rS   ra   s    rc   has_uniform_scalingInsert.has_uniform_scaling  sD     488??#s488??';SSs488???SSSSSrf   c                    US:X  a  [        S5      eXR                  l        XR                  l        XR                  l        U $ )zSet a uniform scale factor.r   zInvalid scale factor.)
ValueErrorrr   rQ   rR   rS   )rb   factors     rc   	set_scaleInsert.set_scale	  s5    Q;455   rf   c                    U R                   (       a9  U R                   R                  R                  U R                  R                  5      $ g)z;Returns the associated :class:`~ezdxf.layouts.BlockLayout`.N)docblocksgetrr   rN   ra   s    rc   blockInsert.block  s-    8888??&&txx}}55rf   c                V    U R                  5       nUb  UR                  R                  $ g)zGReturn ``True`` if the INSERT entity represents a XREF or XREF_OVERLAY.F)r   block_recordis_xrefrb   r   s     rc   r   Insert.is_xref  s(    

%%---rf   c                    Ub  XR                   l        UbO  [        U5      S:w  a  [        S5      eUu  pEnX@R                   l        XPR                   l        X`R                   l        Ub  X0R                   l        U $ )z
Set the location, scaling and rotation attributes. Arguments which are ``None``
will be ignored.

Args:
    insert: insert location as (x, y [,z]) tuple
    scale: (x-scale, y-scale, z-scale) tuple
    rotation : rotation angle in degrees

   z-Argument scale has to be a (x, y[, z]) tuple.)rr   rO   ri   r   rQ   rR   rS   rT   )rb   rO   scalerT   xyzs          rc   placeInsert.place  si      $HHO5zQ#$STTGA!HHOHHOHHO (HHrf   c                     Uu  p4X0R                  l        X@R                  l         Uu  pVXPR                  l        X`R                  l        U $ ! [          a    [        S5      ef = f! [          a    [        S5      ef = f)a   Place block reference in a grid layout, grid `size` defines the
row- and column count, `spacing` defines the distance between two block
references.

Args:
    size: grid size as (row_count, column_count) tuple
    spacing: distance between placing as (row_spacing, column_spacing) tuple

z1Size has to be a (row_count, column_count) tuple.z8Spacing has to be a (row_spacing, column_spacing) tuple.)r   r   rr   rV   rU   rX   rW   )rb   sizespacingrowscolsrX   col_spacings          rc   gridInsert.grid<  s    	UJD " $	'.$K
  +"-  	U STT	U  	J 	s   A A& A#&A<Fc                N   U R                    H   nXR                  R                  :X  d  M  Us  $    U(       an  U R                  ba  U R                  R                  U R                  R
                     nUR                  5        H   nXR                  R                  :X  d  M  Us  $    g)aQ  Get an attached :class:`Attrib` entity with the given `tag`,
returns ``None`` if not found.  Some applications do not attach constant
ATTRIB entities, set `search_const` to ``True``, to get at least the
associated :class:`AttDef` entity.

Args:
    tag: tag name of the ATTRIB entity
    search_const: search also const ATTDEF entities

N)rd   rr   tagr   r   rN   get_const_attdefs)rb   r   search_constattribr   attdefs         rc   
get_attribInsert.get_attribX  sx     llFjjnn$ # DHH0HHOODHHMM2E113**..(!M 4 rf   c                Z    U R                  X5      nUc  U$ UR                  R                  $ )a  Get content text of an attached :class:`Attrib` entity with
the given `tag`, returns the `default` value if not found.
Some applications do not attach constant ATTRIB entities, set
`search_const` to ``True``, to get content text of the
associated :class:`AttDef` entity.

Args:
    tag: tag name of the ATTRIB entity
    default: default value if ATTRIB `tag` is absent
    search_const: search also const ATTDEF entities

)r   rr   text)rb   r   r=   r   r   s        rc   get_attrib_textInsert.get_attrib_texto  s*     3>Nzzrf   c                (    U R                  X5      SL$ )ab  Returns ``True`` if the INSERT entity has an attached ATTRIB entity with the
given `tag`.  Some applications do not attach constant ATTRIB entities, set
`search_const` to ``True``, to check for an associated :class:`AttDef` entity
with constant content.


Args:
    tag: tag name fo the ATTRIB entity
    search_const: search also const ATTDEF entities

N)r   )rb   r   r   s      rc   
has_attribInsert.has_attrib  s     s1==rf   c                    [        U=(       d    0 5      nXS'   X$S'   X4S'   [        SU R                  SU5      5      nU R                  R	                  U5        U R
                  c  U R                  5         U$ )a  Attach an :class:`Attrib` entity to the block reference.

Example for appending an attribute to an INSERT entity::

    e.add_attrib('EXAMPLETAG', 'example text').set_placement(
        (3, 7), align=TextEntityAlignment.MIDDLE_CENTER
    )

Args:
    tag: tag name of the ATTRIB entity
    text: content text as string
    insert: insert location as (x, y[, z]) tuple in :ref:`OCS`
    dxfattribs: additional DXF attributes for the ATTRIB entity

r   r   rO   r0   ATTRIB)dictr   _new_compound_entityrd   appendseqend
new_seqend)rb   r   r   rO   
dxfattribsr   s         rc   
add_attribInsert.add_attrib  sq    $ **+
5!6%8h 9 9(J OPF# ;;OOrf   c                    [        U R                  5       H>  u  p4UR                  R                  U:X  d  M!  U R                  U	 UR	                  5           g   U(       d  [        U5      eg)an  Delete an attached :class:`Attrib` entity from INSERT. Raises an
:class:`DXFKeyError` exception, if no ATTRIB for the given `tag` exist if
`ignore` is ``False``.

Args:
    tag: tag name of the ATTRIB entity
    ignore: ``False`` for raising :class:`DXFKeyError` if ATTRIB `tag`
        does not exist.

Raises:
    DXFKeyError: no ATTRIB for the given `tag` exist

N)	enumeraterd   rr   r   destroyr   )rb   r   ignoreindexr   s        rc   delete_attribInsert.delete_attrib  sW     't||4MEzz~~$LL' 	 5
 c"" rf   c                |    U R                   (       d  gU R                   H  nUR                  5         M     / U l        g)zBDelete all :class:`Attrib` entities attached to the INSERT entity.N)is_aliverd   r   r`   )rb   r   s     rc   delete_all_attribsInsert.delete_all_attribs  s,    }}llFNN #rf   c                \   U R                   n[        [        UR                  5      UR                  UR
                  UR                  4UR                  UR                  S9n UR                  U[        5      nUR                  Ul        UR                  Ul        UR                  Ul        UR                  Ul        UR                  Ul        UR                  Ul        U R                   H  nUR                  U5        M     U R!                  U5        U $ ! [         a    [        S5      ef = f)zTransform INSERT entity by transformation matrix `m` inplace.

Unlike the transformation matrix `m`, the INSERT entity can not
represent a non-orthogonal target coordinate system and an
:class:`InsertTransformationError` will be raised in that case.

)rO   r   rT   rY   zJINSERT entity can not represent a non-orthogonal target coordinate system.)rr   r"   r   rO   rQ   rR   rS   rT   rY   	transformABS_TOLr!   scale_factor_xscale_factor_yscale_factor_zrd   post_transform)rb   mrr   source_systemtarget_systemr   s         rc   r   Insert.transform  s     hh.

#::szz3::6\\mm	
	)33Aw?M
 #))
$--%//"11
"11
"11
llFQ #A ) 	+\ 	s   "D D+c                   U R                  5       nUR                  [        XU5      UR                  U R                  R
                  5      -   5      U R                  l        U R                   H  nUR                  XU5        M     U $ )zWOptimized INSERT translation about `dx` in x-axis, `dy` in y-axis
and `dz` in z-axis.

)ocsfrom_wcsr   to_wcsrr   rO   rd   	translate)rb   dxdydzr   r   s         rc   r   Insert.translate  sc    
 hhj,,tBB'7#**TXX__:U'UVllFRR( #rf   c                   U R                   nUR                  nUR                  nUR                  nU R	                  5       nUR
                  n[        UR                  [        5      5      n[        UR                  [        5      5      n[        R                  " Xr-  X-  Xd-  S9n	[        R                  " UR                  5      n
U
(       a  U	[        R                  " Xj5      -  n	UR                  UR!                  S["        5      5      nU R%                  5       nUb1  XR'                  UR$                  R                   R(                  5      -  nU	R+                  SUR,                  5        U	$ )zReturns a transformation matrix to transform the block entities from the
block reference coordinate system into the :ref:`WCS`.
)uxuyuzrO   r   )rr   rQ   rR   rS   r   r   r   r   r   r   r   ucsmathradiansrT   axis_rotater   r    r   transform_direction
base_pointset_rowxyz)rb   rr   sxsyszr   rY   r   r   r   anglerO   block_layouts                rc   matrix44Insert.matrix44  s    hhZZZZZZhhjFF	#**V$%#**V$%LLBGINC S\\*%%i77ACGGHg67zz|#++L,>,>,B,B,M,MNNF 	
		!VZZ rf   c                F    U R                  5       n[        5       nXl        U$ )zQReturns the block reference coordinate system as :class:`ezdxf.math.UCS`
object.
)r  r   matrix)rb   r   r   s      rc   r   
Insert.ucs  s      MMOe

rf   c                    [         U R                  l        U R                  R                  S5        U R                  R                  S5        g)zuReset block reference attributes location, rotation angle and
the extrusion vector but preserves the scale factors.

rT   rY   N)r    rr   rO   discardra   s    rc   reset_transformationInsert.reset_transformation#  s3    
 "$%rf   )redraw_orderc               X    Uc  U R                  5       nUc  [        S5      e[        XUS9$ )a  Explodes the block reference entities into the target layout, if target
layout is ``None``, the layout of the block reference will be used.
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 scale factors `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.

.. warning::

    **Non-uniform scale factors** may lead to incorrect results some entities
    (TEXT, MTEXT, ATTRIB).

Args:
    target_layout: target layout for exploded entities, ``None`` for
        same layout as source entity.
    redraw_order: create entities in ascending redraw order if ``True``

Returns:
    :class:`~ezdxf.query.EntityQuery` container referencing all exploded
    DXF entities.

z7INSERT without layout assignment, specify target layout)target_layoutr  )
get_layoutr   r#   )rb   r  r  s      rc   explodeInsert.explode,  s@    :   OO-M$'M  'L
 	
rf   c                "    U R                  5       $ )zImplements the SupportsVirtualEntities protocol.

This protocol is for consistent internal usage and does not replace
the method :meth:`virtual_entities`! Ignores the redraw-order!
)virtual_entitiesra   s    rc   __virtual_entities__Insert.__virtual_entities__S  s     $$&&rf   skipped_entity_callbackr  c             #  Z   #    [        U UUS9 H  nUR                  U 5        Uv   M     g7f)a  
Yields the transformed referenced block content as virtual entities.

This method is meant to examine the block reference entities at the target
location without exploding the block reference.
These entities are not stored in the entity database, have no handle and
are not assigned to any layout. It is possible to convert these entities
into regular drawing entities by adding the entities to the entities
database and a layout of the same DXF document as the block reference::

    doc.entitydb.add(entity)
    msp = doc.modelspace()
    msp.add_entity(entity)

.. warning::

    **Non-uniform scale factors** may return incorrect results for some entities
    (TEXT, MTEXT, ATTRIB).

This method does not resolve the MINSERT attributes, only the
sub-entities of the first INSERT will be returned. To resolve MINSERT
entities check if multi insert processing is required, that's the case
if the property :attr:`Insert.mcount` > 1, use the :meth:`Insert.multi_insert`
method to resolve the MINSERT entity into multiple INSERT entities.

This method does not apply the clipping path created by the XCLIP command.
The method returns all entities and ignores the clipping path polygon and no
entity is clipped.

The `skipped_entity_callback()` will be called for all entities which are not
processed, signature:
:code:`skipped_entity_callback(entity: DXFEntity, reason: str)`,
`entity` is the original (untransformed) DXF entity of the block definition, the
`reason` string is an explanation why the entity was skipped.

Args:
    skipped_entity_callback: called whenever the transformation of an
        entity is not supported and so was skipped
    redraw_order: yield entities in ascending redraw order if ``True``

r  N)r$   set_source_block_reference)rb   r  r  r   s       rc   r  Insert.virtual_entities[  s5     ^ 2$;%
A
 ((.G
s   )+c                    U R                   R                  (       a  U R                   R                  OSU R                   R                  (       a  U R                   R                  -  $ S-  $ )zfReturns the multi-insert count, MINSERT (multi-insert) processing
is required if :attr:`mcount` > 1.

r(   )rr   rX   rV   rW   rU   ra   s    rc   mcountInsert.mcount  sO     '+hh&:&:""%)XX%<%<DHH!!
 	
BC
 	
rf   c              #    #    S nS n[        5       nU R                  R                  nU R                  R                  nU R                  R                  n[        U R                  R                  5       H  n[        U R                  R                  5       Hg  n[        X-  Xt-  5      n	X;  d  M  UR                  U	5        U(       a  U	R                  U5      n	U R                  5       n
U" X5        U" X5        U
v   Mi     M     g7f)zYYields a virtual INSERT entity for each grid element of a MINSERT
entity (multi-insert).
c                h    U R                    H"  nUR                  =R                  U-  sl        M$     g r^   )rd   rr   rO   )rO   offsetr   s      rc   "transform_attached_attrib_entities?Insert.multi_insert.<locals>.transform_attached_attrib_entities  s%     ..

!!V+! )rf   c                    U R                   nU=R                  U-  sl        UR                  S5        UR                  S5        UR                  S5        UR                  S5        g )NrV   rU   rX   rW   )rr   rO   r  )rO   r  rr   s      rc   adjust_dxf_attribs/Insert.multi_insert.<locals>.adjust_dxf_attribs  sJ    **CJJ& JKK$KK'KK&KK()rf   N)setrr   rX   rW   rT   rangerV   rU   r   add
rotate_degcopy)rb   r   r#  donerX   r   rT   rowcolr  rO   s              rc   multi_insertInsert.multi_insert  s     
	,	* uhh**hh--88$$++,CTXX223c/1BC%HHV$!'!2!28!<!YY[F&v66vF L 4 -s   B*D0ADc                   ^ ^^^^ SU4S jjmSUUU U4S jjnT R                  5       mTb  T R                  5       mU" 5         T $ )a%  
Attach for each :class:`~ezdxf.entities.Attdef` entity, defined in the
block definition, automatically an :class:`Attrib` entity to the block
reference and set ``tag/value`` DXF attributes of the ATTRIB entities
by the ``key/value`` pairs (both as strings) of the `values` dict.
The ATTRIB entities are placed relative to the insert location of the
block reference, which is identical to the block base point.

This method avoids the wrapper block of the
:meth:`~ezdxf.layouts.BaseLayout.add_auto_blockref` method, but the
visual results may not match the results of CAD applications, especially
for non-uniform scaling. If the visual result is very important to you,
use the :meth:`add_auto_blockref` method.

Args:
    values: :class:`~ezdxf.entities.Attrib` tag values as ``tag/value``
        pairs

c                   > U R                  S5      nTR                  US 5      nUc  U R                  SS5      nU R                  S5      nXU4$ )Nr   r    rO   )popr   )r   r   r   locationvaluess       rc   unpack'Insert.add_auto_attribs.<locals>.unpack  sO    ..'C::c4(D|!~~fb1!~~h/Hh&&rf   c                   > TR                  5        H  n U R                  SS1S9nSU;  a$  [        R                  S[	        U 5       S35        M>  SU;  a$  [        R                  S[	        U 5       S35        Mh  T
" U5      u  p#nT	R                  X#XA5      nU R                  (       a'  U R                  5       nX6l        UR                  U5        UR                  T5        M     g )	Nprompthandle)dropr   z	Skipping z#: missing mandatory 'tag' attributerO   z&: missing mandatory 'insert' attribute)attdefsr   loggerwarningstrr   has_embedded_mtext_entityvirtual_mtext_entityr   embed_mtextr   )r   r   r   r   r3  r   mtextr  r   rb   r5  s          rc   autofill)Insert.add_auto_attribs.<locals>.autofill  s    &..0#..Xx4H.I
 
*NN#CK=0ST :-NN#CK=0VW &,Z&8#8HI33"779E!%J&&u-  #1 1rf   )returnztuple[str, str, UVec]rE  None)r   r  )rb   r4  rC  r  r   r5  s   `` @@@rc   add_auto_attribsInsert.add_auto_attribs  s:    (	'	$ 	$6 zz|#AJrf   c                  > [         TU ]  U5        UR                  nU(       a  UR                  (       a  U R                  R
                  nUc=  UR                  [        R                  S[        U 5       S3S9  UR                  U 5        gX2R                  ;  a=  UR                  [        R                  S[        U 5       S3S9  UR                  U 5        gggg)zValidity check.NzDeleted entity z without a BLOCK name)codemessagez# without required BLOCK definition.)rl   auditr   r   rr   rN   fixed_errorr'   UNDEFINED_BLOCK_NAMEr>  trashUNDEFINED_BLOCK)rb   auditorr   rN   rs   s       rc   rM  Insert.audit  s    gkk3::88==D|###88-c$i[8MN $  d#ZZ'###33-c$i[ 9# $ $ 
 d# ( 3rf   c                V    U R                  5       nUb  UR                  4$ [        5       $ )z,Support for the "ReferencedBlocks" protocol.)r   block_record_handletupler   s     rc   __referenced_blocks__Insert.__referenced_blocks__  s)    

--//wrf   r_   )rE  zlist[Attrib])rE  rh   r^   )rq   zOptional[SubclassProcessor]rE  r2   )r|   r7   rE  rG  )r|   r7   )r   zxref.RegistryrE  rG  )r   r   r   zxref.ResourceMapperrE  rG  )r   float)rE  zOptional[BlockLayout])NNN)rO   zOptional[UVec]r   z$Optional[tuple[float, float, float]]rT   zOptional[float]rE  r9   )r(   r(   rZ  )r   ztuple[int, int]r   ztuple[float, float]rE  r9   )F)r   r>  r   rh   rE  zOptional[Union[Attrib, AttDef]])r1  F)r   r>  r=   r>  r   rh   rE  r>  )r   r>  r   rh   rE  rh   ))r   r   N)r   r>  r   r>  rO   r   rE  r0   )r   r>  rE  rG  rF  )r   r   rE  r9   )r   rY  r   rY  r   rY  rE  r9   )rE  r   )r  zOptional[BaseLayout]rE  r&   )rE  Iterator[DXFGraphic])r  z+Optional[Callable[[DXFGraphic, str], None]]rE  r[  )rE  int)rE  zIterator[Insert])r4  zdict[str, str]rE  r9   )rR  r1   rE  rG  )rE  zIterable[str])/__name__
__module____qualname____firstlineno____doc__DXFTYPEr   r)   r,   acdb_block_reference
DXFATTRIBSpropertyrd   rM   rm   rw   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r	  r  r  r  r  r-  rH  rM  rW  __static_attributes____classcell__)rs   s   @rc   r9   r9      s*    Gz;8LMJ" " ' ' 8<4	 
6I/
?
   T T "&6:$(	 4 "	
 
< NT#7J	: .3&*	(0 AF!$9=	(> FJ!+/	>#, B	>& 59%
JO%
1%
	%
N' PT	5 "M5
 
5n 
 
"!H;z$( rf   )Y
__future__r   typingr   r   r   r   r   r	   r
   typing_extensionsr   r   loggingezdxf.lldxfr   ezdxf.lldxf.attributesr   r   r   r   r   r   r   ezdxf.lldxf.constr   r   r   r   r   
ezdxf.mathr   r   r   r   r   r   r   r    ezdxf.math.transformtoolsr!   r"   ezdxf.exploder#   r$   ezdxf.entitiesr%   ezdxf.queryr&   ezdxf.auditr'   	dxfentityr)   r*   dxfgfxr+   r,   r-   r.   	subentityr/   r   r0   r1   r2   r3   r4   ezdxf.layoutsr5   r6   ezdxf.lldxf.tagwriterr7   r:   r8   __all__	getLoggerr<  r   is_valid_block_name	any_pointis_not_zerois_greater_zeropoint3dis_not_null_vectorrc   acdb_block_reference_group_codesro   register_entityr9    rf   rc   <module>r     s   #   #   !   	 	 	 # # " 4  & #>>57*			7	#
 #!"a$?Y%B%BC"EOO4 RT:++ 
 ++ 
 ++ 
 BD9// 
 // 
 ""a$?r1t<--22 
]69 t $66J#K  5= $ 	r	^ r	 r	rf   