Hi I am trying to create to a document like the image below. It has a preview image of the family in the first column. The type name in the second column. And the file path of the family document in the third column.
I have managed to get all the pieces required to build the family library document. The difficult part is exporting this information to a suitable place. The image below uses a Bumblebee package workflow to embed the images in the Excel document but it is not stable and the images if made larger overlap so large or small not useful.
I was hoping GoogleSheets might work but BIMPlus Googlesheet package canât embed images just image URLs and I canât automate uploading lots of images. So I think that is also not a solution.
So I am thinking of creating a drafting view and importing images and creating text notes. But I would prefer an external document to avoid opening a Revit project. Does anyone know of a way of getting this information from Dynamo into a document for easy viewing?
Script contents: Python get a list of furniture family types. Python get family folder location. Python get Preview image of Family. Export Images. Create Excel. Bumblebee Embed images.
Edit: Would it be possible to use IronPython Microsoft Word Interop to Embed images in word. I have limited python skills also on my work computer I can not install extra Python modules.
When you adjust the row height it stretches and distorts the image. It doesnât remove the overlapping either. But I could possibly do something about that with an Excel macro I could buy except the images keep disappearing. So I am going to investigate exporting to Word. I will post here if I get something useful.
Jacob a small question; can we make excel cells larger using dynamo so that they do not overlap? or we need to do it manually after the export command?
Not with the out of the box tools. Bumblebee package may have this available. Or you could preform at the spreadsheet in sheet2 and populate the contents with a formula that is â=sheet1cellâ, and have Dynamo write data to sheet1. Then just do a save as every time before you write the data.
Unfortunately I donât think the Bumblebee will work in this situation.
Are the images family preview images? I think @c.poupin clipboard and paste is only workable solution for getting the images into Excel in a stable way and a useable size.
What are the Revit parameters you want to export, I could try edit his Python script.
I only slightly modified the python script in the solution above. Also I never solved the problem of the many pop-ups which make it not very useful. If I get a chance when at work I will copy the python here.
Hi Simon. I wanted to quickly hop on here and raise some questions. I noticed that you modified the script so it skips model text⌠For detail items, since filled regions are under detail items and filled regions actually arenât families, it actually causes problems when detail items (OST_DetailComponents) is brought in. I am wondering how one would go about to filter out the filled regions, assuming that will have to be done in the script rather than the category.
BTW, I didnât notice the pop-ups, I did however get errors and the data wouldnât properly write on the spreadsheet. I later noticed that it only happens if you run the script more than one time, and errors will go away if you restart your pc. I know it has to do with the copy and paste mechanism in Microsoft.
I think it would be tricky to filter within a category because the way the script is written. But maybe you could do this step with nodes and include this list in the bit that starts the copy paste mechanism of the script which I donât have the ability to adjust if this bit is causing a problem. Sorry canât be more help I made this dynamo script a long time back and donât use it anymore.
Thank you for your reply Simon. I came across this thread because I am trying to achieve something similar that you were doing, except I need to add detail items to the mix. I tried to feed families directly into the script and didnât get any errors but it doesnât look like the families made it through the script.
I am tagging @c.poupin since they are the one who incorporated the copy and paste mechanism. Are you familiar with how one should go about filtering filled regions from detail items category (OST_DetailComponents)? I tried feeding detail item families directly into the script instead of the detail item category (to avoiding getting the error âAttributeError: âFilledRegionTypeâ object has no attribute âFamilyââ. Because initially it seems to me the reason I got the error was because the filled regions donât have families, they are just types. But even feeding families directly into the script doesnât produce anything. I didnât get error this time but those families didnât make it to the spreadsheet.
This might work. I am still not sure why directly feeding the script with the detail items families donât produce anything in the spreadsheet.
for famt in list familyTypes:
Would this line even work? Do you mean just âfamilyTypesâ?
Edit:
So it gives me an error âNameError: name âfamilyTypesâ is not definedâ
Edit 2:
So I donât know if you are still on mobile, I made some changes to your script and I am going to paste part of the script here. I called fecsNew instead of familyTypes. And I got a new error message. âAttributeError: âPanelTypeâ object has no attribute âForegroundPatternColorââ. Seems like panel style also belongs to the detail item category, it isnât just filled region I need to get rid of.
#collector
fecSymb = FilteredElementCollector(doc).WherePasses
(filtercat).WhereElementIsElementType().ToElements()
fecNew = []
for fec in fecSymb:
if fec.FamilyName == "Model Text":
pass
else:
fecNew.append(fec)
catName = []
sortedsymbs = []
FinalFamiliesList = []
for famt in fecNew:
if famt.ForegroundPatternColor and famt.BackgroundPatternColor == 'null':
FinalFamiliesList.append(famt)
fecNew = FinalFamiliesList
for s in fecNew:
fam = s.Family
cat = fam.FamilyCategory
catName.append(cat.Name)
Hello @BI_2
if your goal is to remove âFilledTypeRegionâ of the list
you can replace this line fecSymb = FilteredElementCollector(doc).WherePasses(filtercat).WhereElementIsElementType().ToElements()
by this line fecSymb = FilteredElementCollector(doc).OfClass(FamilySymbol).WherePasses(filtercat).ToElements()
Hi @c.poupin, thank you for the reply. That line did it. Now I am finally getting what I wanted in the spreadsheet. The only thing that isnât working is the preview image. The detail items preview image is shown as âX---------------Xâ. All of my detail items are 2D elements so I thought maybe thatâs why (the 3D preview images are normal) but I noticed that other generic models that are 3D is also showing âX----------Xâ as preview image in the spreadsheet. I couldnât quite pinpoint where it went wrong.