OSArch Community

BlenderBIM - Add images to layout

  1. T

    Hi,

    I'm trying to make a sheet with some model views. I've created the sheet and added a drawing. Then I click on Edit Sheet to edit the layout and place the drawing where it needs to be. Here I also want to add some more graphics, i.e. images that describe some materials or photographs of existing conditions. When I edit the layout and save it, then click on Create Sheets, BlenderBIM throws an error:

    
    File "...\blenderbim\bim\module\drawing\sheeter.py", line 358, in build_drawings
    
    if image.attrib["data-type"] == "background":
    
    KeyError: 'data-type'
    

    This suggests that the elements I add manually to the sheet need to either include a data-type property or I need to edit build_drawings to first check for the data-type prop. I'll try modifying the code to allow this - but wanted to check if there is already a way to add more elements to a layout easily, so that they can be included in the created sheet?

  2. T

    In sheeter.py, line 357 changing

    
    for image in images:
    
        if image.attrib["data-type"] == "background":
    
            background = image
    
        ...
    

    to

    
    for image in images:
    
        if "data-type" not in image.attrib:
    
            view.append(image)
    
            continue
    
        if image.attrib["data-type"] == "background":
    
        ...
    

    seems to do the trick :)

  3. T
  4. T

    Thanks! I wasn't aware of that :) That is probably the right way to do it.

Login or Register to reply.