Beispiel #1
0
    def _build(self):
        def set_tags(insert_entity):
            basepoint = self.blockdef['basepoint']['xyz']
            for tag, text in self.attribs.items():
                try:
                    attdef = self.blockdef.find_attdef(tag)
                    attrib = attdef.new_attrib(text=text)
                    insert_entity.add(attrib,
                                      relative=True,
                                      block_basepoint=basepoint)
                except KeyError:  # no attdef <tag> found
                    pass

        insert = Insert(blockname=self.blockdef['name'],
                        insert=self.insert,
                        rotation=self.rotation,
                        layer=self.layer,
                        color=self.color,
                        linetype=self.linetype)
        for key, value in [('xscale', self.xscale), ('yscale', self.yscale),
                           ('zscale', self.zscale)]:
            if value != 1.:
                insert[key] = value

        set_tags(insert)
        return insert.__dxf__()
Beispiel #2
0
    def _build(self):
        def set_tags(insert_entity):
            basepoint = self.blockdef['basepoint']['xyz']
            for tag, text in self.attribs.items():
                try:
                    attdef = self.blockdef.find_attdef(tag)
                    attrib = attdef.new_attrib(text=text)
                    insert_entity.add(attrib, relative=True, block_basepoint=basepoint)
                except KeyError: # no attdef <tag> found
                    pass

        insert = Insert(blockname=self.blockdef['name'], insert=self.insert,
                        rotation=self.rotation,
                        layer=self.layer, color=self.color,
                        linetype=self.linetype)
        for key, value in [('xscale', self.xscale),
                           ('yscale', self.yscale),
                           ('zscale', self.zscale)]:
            if value != 1.:
                insert[key] = value

        set_tags(insert)
        return insert.__dxf__()