Today, we look at the Revit API to personalise material assets, access the built-in browser functionality, create schedules, search text and miscellaneous LLM-related news items:
MatMul
Jacob Small provided a useful and succinct summary of info to help answer how to create a custom material asset:
Question: I would like to know if it is possible to create a personalised material asset with personalised properties that can be displayed in the Material Browser. For example, a material asset called "Test" placed after "Thermal". And in "Test" put a property like "Address". If this isn't possible, is it possible to add the "Address" property to an asset that already exists, for example "Identity"? If so, can we then create a new section in the Identity asset as "Additional information"?
Answer: Some quick 'info' on what I think I know about material assets:
The only "asset types" in the UI are Appearance, Thermal, and Physical. In the API these are called Appearance, Thermal, and Structural (because why would they match?). I'll be using the API names going forward because we're in that forum (perhaps someone curious can ask about the UI stuff in the other forum).
The Thermal and Structural asset types can be deleted from a material in the UI and set as an invalid Element Id in the API. The Appearance asset cannot.
The other tabs in the material editor are collections of properties and parameters of the material element itself, not a linked asset - but are masquerading as an asset due to how they are presented in the UI. For example to get the name (shows in the identity tab) you get the Name property of a material element. To get the foreground surface pattern (shows in the graphics tab) you'd get the SurfaceForegroundPatternId property. To set the Comments in the Identity tab you'd use a Set method on the comment parameter.
The only thing unavailable is the keywords (noted as missing in 2019 and as far as I know still unavailable).
So the question becomes, how can you accomplish what you're after?
You could map a property from the identity tab (URL looks like an option) to an extensible storage object with the data you need; however users won't be able to edit it in the material editor. Personally I would make 'non-UserModifiable' parameters on the materials category, and associate them to the materials in your template, and let them be edited/reviewed via an add-in which would also allow updating the rest of the assets. This add-in could also ensure that materials added via your tool would have these hidden parameters quickly set when materials from your library (a sub-component of your add-in) are added to the model.
It'd be a big lift but likely one which would benefit many beyond your company.
Many thanks to Jacob for this helpful summary.
Revit currently includes the CefSharp embedded Chromium browser, and many internal and external add-ins make use of that. Another option for Chromium embedding is provided by WebView2, and some add-ins already use that instead. This StackOverflow question provides a comparison of CefSharp vs WebView2. If you are interested in new developments in this area in the context of Revit API add-in development, you might want to check in to the corresponding discussion currently opened in the Revit Preview Project.
Twentytwo, written by Min Naung, provides a place and resources for BIM Programming enthusiasts. Quite a while ago, I already mentioned the TwentyTwo add-ins and tutorials. They also write a blog with high quality Revit API articles, the Revit API series.
One of them, for instance, on schedule creation, recently came in useful and helped solve the question on sort/grouping field in schedule.
Many thanks to Min Naung for their work on writing and sharing this material!
I use grep
in my everyday work to search for text in text files.
With ugrep
, this workflow can be easily expanded to cover all kinds of other file formats and directory structures,
cf. the ugrep file pattern searcher, with
its ugrep GitHub repo.
For instance, PDF support can be obtained by specifying a filter like this:
ug --filter='pdf:pdftotext % -' -i searchtext *pdf
The ug+
command is the same as the ug
command plus built-in filters to search PDFs, documents, and image metadata:
ug+ -i searchtext *pdf
Fuzzy search is also supported, among tons of other features:
ug+ -Z -i searchtext *pdf
AI and LLMs can be used with 3D objects, but often have trouble understanding and efficiently handling them. The MeshAnything project aims to generate more effective meshing of 3D objects:
Josh Whiton performed an experiment on LLM self-reflection showing that Claude Sonnet 3.5 passes the AI mirror test, ending with an LLM-generated poem on the topic:
On the other hand, Mark Bishop shares a critical article stating that artificial intelligence is stupid and causal reasoning will not fix it, also presented as a 90-minute video on deep stupidity, a provocation on the things LLMs can and cannot do.
This new research may affect both the enormous resources consumed by AI and the chip maker stock prices: Researchers upend AI status quo by eliminating matrix multiplication in LLMs.
For experimentation and learning, the CodeProject.AI Server provides AI the easy way:
CodeProject.AI Server is a locally installed, self-hosted, fast, free and open-source AI server for any platform, any language. No off-device or out of network data transfer, no messing around with dependencies, and able to be used from any platform, any language. Runs as a Windows Service or a Docker container.