Room object in Revit files - autodesk-forge

I followed the instruction in the link below to extract Room objects from Revit models:
https://forge.autodesk.com/blog/new-rvt-svf-model-derivative-parameter-generates-additional-content-including-rooms-and-spaces
I made the changes as instructed and tested the sample Revit file (rac_basic_sample_project.rvt). But, still I don't see the rooms or the viewables (phases). Below is fhe request I post. Am I missing anything?
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YzQ4ZDUxNDNhMDRiNDAxNmI3ODYxY2NlMzQ2ZDkyNjdfZmFjaWxpdHlfOTUvZWIyYzMzNDgtNDAxYS00ZjQ3LTgwM2EtMjM1OGYwYmI0YjY2LnJ2dA"
},
"output": {
"destination": {
"region": "us"
},
"formats": [
{
"type": "svf",
"views": [
"3d"
],
"advanced": {
"generateMasterViews": true
}
}
]
}
}

I just tested the feature and I can see the room data:
The JSON payload seems ok, so try checking the following things:
Make sure you use the x-ads-force header (explained in the blog post you linked to); if you had already processed your Revit model before, triggering a new Model Derivative job would not do anything unless you force the translation
Try using another design (and from a newer version of Revit if possible); in my screenshot I'm using one of the official samples for Revit 2020, although I remember being able to get the room data from older samples as well
The room data is only available in certain "viewables" so make sure you're looking at the right one; for my sample project, for example, the room data is not available in the "{3D}" viewable but it is available in the "Working Drawings" viewable

Related

Autodesk Forge Viewer is not rendering SVF derived from IFC

IFC model has been uploaded and translated to SVF.
the problem is reproduced on https://autodesk-forge.github.io/forge-tutorial-postman/display_svf.html. The viewer is rendering forge logo indefinitely. The console shows an error:
"TypeError: undefined is not an object (evaluating 't.children.length')"
We are experiencing this since Tuesday, 26 Oct, 2022 06:45 AM (GMT).
This is the body of the Translate Job Post API:
{
"input": {
"urn": "{{t4_ossEncodedSourceFileURN}}"
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d", "3d"
],
"advanced": {
"conversionMethod": "modern",
"buildingStoreys": "show",
"spaces": "show",
"openingElements" : "show"
}
}
]
}
}
The same model is successfully presented when translated to SVF2.
We tested this executing multiple scenarios using multiple models.
Using postman collections, both versions with signedcookies and without show the same behavior.
In our system , we are translating models to SVF and downloading derivatives to serve those from our own servers. The same behavior is noticed there. We are using forge-server-utils version 8.3.4 for download
Also, vscode-forge-tools Visual Studio Code extension shows the same behavior.
Models translated before the date indicated above are rendered correctly.
Kindly asking for help, this has a big impact on our service.

How to use the type "expandable" correctly?

Question
How to use the type "expandable" correctly?
Description
I have a batch that runs every hour and sends some stats to our slack. Each JSON output can be quite large and I'm looking for a way to have it collapsable/expandable.
I was playing with slack's BlockKit Builder in hopes that there was something of the sort, and I came across (when looking at the message errors) that there is a type called expandable.
However, there is no (?) documentation regarding it. The only thing that I know is.
It requires a blocks property
It should be a child of a blocks property
What I've tried
I went on the block builder (demo) and was able to get this to not throw any errors but there was no visual output...
{
"blocks": [
{
"type": "expandable",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Hello, Assistant to the Regional Manager Dwight! *Michael Scott* wants to know where you'd like to take the Paper Company investors to dinner tonight.\n\n *Please select a restaurant:*"
}
}
]
}
]
}
What I would like:
I would like to have a working collapsable/expandable and understand what the different properties are and how they work.

Define IFC Mvd on posting translation job

On translation of RVT file to SVF, I also want to post a job to translate and download an IFC file. Opening that IFC file after translation, it seems to use CV1 - Coordination View 1, which is a very old Model View Definition (hardly in use anymore and only for IFC2x3). If I export same RVT file in Revit 2016 with newest IFC exporter downloaded, choosing CV1 as an option, the file size of the IFC file translated from Revit is half the size of that from Forge. Is there a way to specify which MVD to use for the IFC translation using Model Derivative API, as it is in Revit (CV2, COBIE, IFC4 RV/DTV)? Since it seems that Forge uses the Revit IFC exporter, I would anticipate this be an option, but so far I have not succeeded finding it.
2019 Update
Just got informed, the issue REVIT-125299 has been resolved according to our engineering team. So, please try to submit the job body like below, use IFCExportOption instead, then you will obtain an IFC exported with the specified export setting. Cheer!
{
"input": {
"urn": "{{base64URN}}"
},
"output": {
"formats": [
{
"type": "IFC",
"views": [
"2d",
"3d"
],
"advanced": { //!<<< export options start
"IFCExportOption": "IFC4 Design Transfer View"
} //!<<< export options end
}
]
}
}
The old
After checking with our engineering team, Forge MD has supported to set IFC export options up like in Revit. For example,
{
"input": {
"urn": "{{base64URN}}",
"compressedUrn": false,
"rootFilename": "{{Filename}}"
},
"output": {
"formats": [
{
"type": "IFC",
"views": [
"2d",
"3d"
],
"advanced": { //!<<< export options start
"exportSettingName": "IFC4 Design Transfer View"
} //!<<< export options end
}
]
}
}
IFC exporter will try to seek for the saved export settings in your uploaded RVT based on the exportSettingName. If there is no matched setting, it will use IFC2X3 by default as I experience.
But there is a issue related to this feature, the output might not matched with the export settings, it has been logged as request id REVIT-125299 in our internal case system to make our team to allocate time to investigate. Apologies for any inconvenience caused.
However, you can sent the request id to forge.help#autodesk.com in the future to track updates. Thank you~
P.S. The above code sample might be changed in the future, please follow with the official documents: https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/

getDegree()/isOutgoing() funcitons don't work in graphAware/neo4j-to-elasticsearch mapping.json

Neo4j Version: 3.2.2
Operating System: Ubuntu 16.04
I use getDegree() function in mapping.json file, but the return would always be null; I'm using the dataset neo4j tutorial Movie/Actor dataset.
Output from elasticsearch request
mapping.json
{
"defaults": {
"key_property": "uuid",
"nodes_index": "default-index-node",
"relationships_index": "default-index-relationship",
"include_remaining_properties": true
},
"node_mappings": [
{
"condition": "hasLabel('Person')",
"type": "getLabels()",
"properties": {
"getDegree": "getDegree()",
"getDegree(type)": "getDegree('ACTED_IN')",
"getDegree(direction)": "getGegree('OUTGOING')",
"getDegree('type', 'direction')": "getDegree('ACTED_IN', 'OUTGOING')",
"getDegree-degree": "degree"
}
}
],
"relationship_mappings": [
{
"condition": "allRelationships()",
"type": "type",
}
]
}
Also if I use isOutgoing(), isIncoming(), otherNode function in relationship_mappings properties part, elasticsearch would never load the relationship data from neo4j. I think I probably have some misunderstanding of this sentence only when one of the participating nodes "looking" at the relationship is provided on this page https://github.com/graphaware/neo4j-framework/tree/master/common#inclusion-policies
mapping.json
{
"defaults": {
"key_property": "uuid",
"nodes_index": "default-index-node",
"relationships_index": "default-index-relationship",
"include_remaining_properties": true
},
"node_mappings": [
{
"condition": "allNodes()",
"type": "getLabels()"
}
],
"relationship_mappings": [
{
"condition": "allRelationships()",
"type": "type",
"properties": {
"isOutgoing": "isOutgoing()",
"isIncomming": "isIncomming()",
"otherNode": "otherNode"
}
}
]
}
BTW, is there any page that list all of the functions that we can use in mapping.json? I know two of them
github.com/graphaware/neo4j-framework/tree/master/common#inclusion-policies
github.com/graphaware/neo4j-to-elasticsearch/blob/master/docs/json-mapper.md
but it seems there are more, since I can use getType(), which hasn't been listed in any of the above pages.
Please let me know if I can provide any further help to solve the problem
Thanks!
The getDegree() function is not available to use, in contrary to getType(). I will explain why :
When the mapper (the part responsible to create a node or relationship representation as ES document ) is doing its job, it receive a DetachedGraphObject being a detached node or relationship.
The meaning of detached is that it is happening outside of a transaction and thus query operations are not available against the database anymore. The getType() is available because it is part of the relationship metadata and it is cheap, however if we would want to do the same for getDegree() this can be seriously more costly during the DetachedObject creation (which happen in a tx) depending on the number of different types etc.
This is however something we are working on, by externalising the mapper in a standalone java application coupled with a broker like kafa, rabbit,.. between neo and this app. We would not, however offer the possibilty to requery the graph in the current version of the module as it can have serious performance impacts if the user is not very careful.
As last, the only suggestion I can give you is to keep a property on your node with the updates of degrees you need to replicate to ES.
UPDATE
Regarding this part of the documentation :
For Relationships only when one of the participating nodes "looking" at the relationship is provided:
This is used only when not using the json definition, so you can use one or the other. the json definition has been added later as addition and both cannot be used together.
For answering this part, it means that the nodes of the incoming or outgoing side, depending on the definition, should be included in the inclusion policy for nodes, like hasLabel('Employee') || hasProperty('form') || getProperty('age', 0) > 20 . If you have an allNodes policy then it is fine.

export whole Neo4j database / cypher result to GraphJSON

I´ve already had a look at different post like this and this but nothing seems to be answered 100%.
My current problem is, that I want to visualyze - and ideally - analyze my Neo4j-Graph with a library (or software/tool).
The database-server is running on a remote (virtual) server and it seems that there is no chance to export the database to a format where I can work on with.
I´ve tried exporting the graph in a .graphml-file to import this file in Gephi, but Gephi doesn´t find the properties. Gephi-streaming with apoc-procedures and the graph-streaming plugin also does not work, because it´s a remote server (also with the tool mentioned here).
Now I´m currently testing around with Alchemy.js... So far, so good. But as it seems there´s no way to export the graph/query to the GraphJson-format?
Is there really no "easy" way to export the data?
Thanks for your help in advance!
This is how I would proceed
Run this query from the post you mentioned in the Neo4j Browser or in any bolt driver:
MATCH (a)-[r]->(b)
WITH collect(
{
source: id(a),
target: id(b),
caption: type(r)
}
) AS edges
RETURN edges
Now that you have loaded the data, you can simply download it as JSON using download button.(if you are using bolt driver ignore)
Either you manually downloaded JSON from Neo4j Browser or you are using bolt driver, you will end up with something like this.
{
"columns": [
"edges"
],
"data": [
{
"row": [
[
{
"source": 31288,
"target": 152,
"caption": "HAS_PAYMENT_METHOD"
}
]
],
"meta": [
null
],
"graph": {
"nodes": [
],
"relationships": [
]
}
}
]
Now all you have to is to filter out data.row results and you are done. Probably using bolt driver is the better choice as you have to clean up data anyway and it doesnt run into issues with returning a lots of data to the browser(it might crash).
Update: added python version
from neo4j.v1 import GraphDatabase
driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "neo4j"))
session = driver.session()
result = session.run("MATCH (a)-[r]->(b) WITH collect({source: id(a),target: id(b),caption: type(r)}) AS edges RETURN edges")
for record in result:
print(record["edges"])
Hope this helps