https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-core.min.js
https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js
code[class=language-], pre[class=language-] { font-size : 90%; }
We present a long-awaited solution to check for a valid Revit API context and a whole bunch of short pointers to other topics of interest, mostly AI related:
- Determining Revit API context
- Detect Revit user input state
- Easy Revit API
- Gemini with image and video input
- LLM is not self-aware
- Generative AI transformer
- Design to reduce junk data
- C and C++ are risky
- Ultra-processed food is toxic
Determining Revit API Context
Luiz Henrique @ricaun Cassettari finally cracked the
question how to know if Revit API is in context:
Revit API throws exceptions if your code is trying to execute Revit API methods in a modeless context, e.g., a WPF modeless view; that’s the reason you need to use
ExternalEventto execute Revit API code in context.Sometimes you need to know whether code is running in context or if not, to just execute the Revit API code right away or send it to ExternalEvent to be executed.
If you have access to
UIApplicationorUIControllerApplication, and if you try to subscribe to an event outside Revit API context, you are gonna have this exception: Invalid call to Revit API! Revit is currently not within an API context.Meaning: you can use that to know if your code is in context or not.
- Code sample and video
- 14-minute video on Tasks and InContext in Revit API
I’m using this technique using my open source library to manage the creation of an external event if it is not in context and enable it to run Revit API asynchronously in ricaun.Revit.UI.Tasks.
Many thanks to ricaun for sharing this long-sought-after solution!
Detect Revit User Input State
In a related vein, we also discussed the question
of detecting Revit user input state in real-time via Revit API.
Easy Revit API
Big welcome to a new member in the Revit programming blogosphere,
Easy Revit API.
Welcome, Mohamed-Youssef.
Best of luck and much success with your blog and other projects!
<!–
#### APS Toolkit
In the last post,
I mentioned Chuong Ho‘s
BIM interactive notebooks.
Now you can see how he put them to use in his newest project,
the APS Toolkit:
I am excited to announce a significant development in data interaction and retrieval processes using Autodesk Platform Services from Autodesk. Today, I am officially releasing the first version of a toolkit designed to facilitate data access, aiming to support AI processes, Data Analysts, LLM, and explore the boundaries where APS may fall short in providing for end-users.
This toolkit is open source, ensuring accessibility to all engineers, BIM developers, and data scientists. I am actively working on refining it further. Please feel free to provide any feedback in the comments below this post, and I will consider all suggestions.
APS Toolkit empowers you to explore the Autodesk Platform Services APS.
It’s built on top of Autodesk.Forge
and Newtonsoft.Json.
The toolkit includes features enabling you to read, download and write data from APS and export to CSV, Excel, JSON, XML, etc.
Features:
– Read/Download SVF Model
– Read/Query Properties Database SQLite
– Read/Download Properties Without Viewer
– Read Geometry Data
– Read Metadata
– Read Fragments
– Read MeshPacks
– Read Images
– Export Data to CSV
– Export Data to Excel
– Export Data to Parquet
Sample usage to export Revit Data To Excel using .NET C#:
5568aa624adb01ea02f43326a83278ef
Sample usage to export Revit Data To Excel using Python:
748c57a103e6039f5a960be8980fd06e
Many thanks to Chuong Ho for creating and sharing this powerful toolkit!
–>
Gemini with Image and Video Input
An impressive example of use of LLM with video input support is presented stating
that [the killer app of Gemini Pro 1.5 is video](https://simonwillison.net/2024/Feb/21/gemini-pro-video.
I tested using Gemini myself for
a Revit API discussion forum question
on 2024 dark theme colouring addins with
acceptable and useful results, afaict.
LLM is not Self-Aware
… Even
though Anthropic’s Claude 3 causes stir by seeming to realize when it was being tested.
Generative AI transformer
A nice beginner’s guide to understanding LLM explains
why generative AI exists because of the transformer.
Design to Reduce Junk Data
We are generating huge and ever-growing amounts of data, much of which is useless and never looked at again, so it is well worth
pondering – and avoiding — design patterns that encourage junk data.
C and C++ are Risky
70 percent of all security vulnerabilities are caused by memory safety issues, and many of those are automatically eliminated by working in a memory-safe programming language.
Therefore,
the White House urges developers to dump C and C++.
Ultra-Processed Food is Toxic
Talking about things we ought to dump, I seldom watch long videos, but this hour-long one had me mesmerised all the way through:
the harsh reality of ultra processed food with Chris Van Tulleken.


Leave a Reply