How to move section gizmo in Forge Viewer - autodesk-forge

When using the section tools in the Forge viewer on models that cover a large area it's very difficult to use. Is there any way I can move the section gizmo to a certain point in the model? I would prefer it to be in the center of current view, not in the center of the bounding box of the entire model.

Unfortunately there's no official way to change the behavior of the section tool and its gizmo. I do agree that moving the gizmo relative to the view would make more sense than just using the bounding box, and I will report this request to the dev. team.

Related

How to show/hide part of an element in Autodesk Viewer v7

We currently use the model derivatives API to upload 3D models and later visualize them in a browser with the Autodesk Viewer v7 (previously Forge Viewer).
For different reasons we have been trying to hide and show parts of the model, but to do so in some cases we need to be able to hide geometric pieces of some elements while still being able to see the rest. For example if we had an element in gray (see image below) we would like to make the part of the element in red transparent.
I have looked into the Viewer API docs and there are functions that allow showing and hiding complete elements, but not cutting elements along a custom path.
While the docs mention the overlay functionality which enables us to add custom geometries by interacting with the THREE library that the Viewer runs on, drawing a copy of the whole model seems inefficient and prone to giving bad results.
Searching in SO I found that the THREE v71 library (which is the version the Viewer uses) has the possibility of occluding elements with the colorWrite option. See these links for reference:
three.js transparent object occlusion
Occlusion of real-world objects using three.js
I tried implementing something similar by using the colorWrite key when creating a new Three Material in an overlay, but nothing happens. This makes me think that either the Autodesk Viewer overwrites the render order (which makes sense) or openly ignores the colorWrite option. Does anyone know why and if there is a workaround for this? Or does anyone know if there is another way to cut an element that I'm not considering?
Please note that we have to do this with multiple elements at the same time and that reuploading the model periodically is not an option for us.
I got the following feedback:
The approach linked in the SO thread doesn't work, because we ignore both the colorWrite material property and the renderOrder mesh property. I also think that the approach would not work as expected in general, because using an invisible object to occlude a part of another object would always be view-dependent, and also occlude other objects in the background (so it wouldn't just 'cut out' a part of a single object).
Generally, this is not really a use-case for LMV, because it's a viewing tool, not a solid modelling tool.
Cut planes might help to get some of what you want, but they also have limitations:
It's possible to define multiple section planes to construct a 'shape' (that's also what the section box does internally). But since they are infinite, you wouldn't be able to cut away parts of one object, but not other objects (or other parts of the same object that intersect the cutplane). They're also designed to be 'outward' facing. The section box, for example, can only be used to narrow the scene down to some elements of interest. It's not possible to do the opposite, i.e. cut out some inner part of the design and keep everything around it.
This is what the section box could offer:

Rotate section box

The section box is currently not able to be rotated natively (as I see it at least). Because very few models/objects are actually placed perpendicular to X/Y I have been trying to look into a method for doing this.
Does anyone know of a method for doing this?
Anyone know if this is something that are being considered implemented in the near future?
It would be nice to include the rotation gizmo from the normal section plane, or have the box natively be added to follow the orientation of the face selected when creating it through the viewer UI.
Thank you in advance
Rotating the section box is not possible today, and as far as I know there are no plans for that, either.
Depending on what your exact use case is, you could potentially achieve what you need by rotating the model (using model.setPlacementTransform(xform)) and not the section box.

How to export view as multiple images in Revit API?

Is it possible to export a view as more than 1 image? in any kind of split.
When exporting the view as an Image I want to keep the scaling consistent and Revit will not allow export an image with more than 15000 pixels. So on big Models I want to split the image to keep the meter per pixel consistent.
Any other suggestions are welcome.
I am not aware of any such possibility.
Please be aware of the following rule of thumb:
In general, if a feature is not available in the Revit product manually through the user interface, then the Revit API will not provide it either.
You should therefore research the optimal workflow and best practices to address your task at hand manually through the Revit user interface first.
To do so, please discuss and analyse it with an experienced application engineer, product usage expert, or product support.
Once you have got that part sorted out, it is time to step up into the programming environment.
I hope this clarifies.
I was able to do it by cropping different parts of the view and hiding everything outside the crop before the export. As the image export only export the visible elements.
I've encountered a different issue now, there are different visible objects outside of the actual model that interfere with the image export, sometimes those are elevation markers, site internal origin, other hidden annotations and many more.
Is there a way to hide absolutely everything outside the crop? do I need to go over every instance of a list of possible visible objects and hide them?
Thank you for sharing your solution to the original question on exporting several images displaying different elements by toggling their visibilities.
Regarding your second, new, question, on interfering elements such as 'elevation markers, site internal origin, other hidden annotations and many more':
Yes, indeed, I would suggest hiding those as well, just as you successfully handled the other 'standard' BIM elements, e.g., using the HideElements method, HideElementsTemporary, or, maybe better still for such special element types, hiding their entire categories using HideCategoriesTemporary.

Change size of cutplanes tool in Forge Viewer

I'm using ForgeViewer to display both IFC models and custom geometry (point clouds and meshes using THREE.js directly), and I'm using the Section tool to cut away parts of the model.
Is there anyway I can set the size of the planes in the UI. I want the arrows and planes to be centered around specific models making them easier to use. Also, it would be nice to be able to set the default size and position of the cutting box.
The size of the cutting plane/box as well as the position of the manipulating gizmo are estimated by the section tool based on the bounding box of all visible objects. There's no UI to change that behavior, but you might be able to reverse engineer the official Section tool and perhaps modify it to your needs.
Edit: alternatively, you could retrieve the THREE.js geometry representing the cutting plane after it's been created by the Section tool (and placed into viewer.impl.sceneAfter) and customize it as needed.
Adding to Petr's answer...
Use the 'box section' tool (see screenshot) and manually adjust the box size by clicking on each of the box faces to adjust.
Then use Augusto's blog post (below) to programmatically capture (using viewer.getState();) and replay your box section (viewer.setCutPlanes(planes);).
https://forge.autodesk.com/blog/viewer-setcutplanes

How to force report items to overlap?

I'm trying to create doughnut chart and insert label inside the chart's hole. When I render report, label is being moved outside the chart.
Is it possible to force report items to overlap instead of position it automaticaly?
I was looking for an answer to this earlier! I was trying to overlay a rectangle shape on to an image of a site-map.
Unfortunately the answer is no, due to the way that HTML renders objects:
http://msdn.microsoft.com/en-us/library/dd255248.aspx
Very old question, but page overlapping is supported in hard page break formats, such as PDF, or physical print of a report. Essentially, any other format (such as HTML or the Report Builder tool) will move your items around the page, but if you export that same (non-overlapped) report to PDF, your items will be displayed as you intended, with overlapping items.
See here for further details
You can "Add New Title" at the chart at set its position to "BottomCenter".
Right click the chart and select "Chart">"Add New Title". Place the title bottom centered and resize the text
The result in Report Manager:
Number within a chart
Overall Answer:
Unfortunately, SSRS is not graphic, design, layer friendly. The way it renders objects is based on it's boarders. So overlapping is very difficult, time consuming and in most scenarios not possible. Unless you are good with VB programming you may be able to get by with custom code at the report properites -> Code window. It's sad that powerpoint, word, excel natively have better design capabilities than SSRS. Like who in their right mind would ever think that people only want to see data represented in a tablix or box. SSRS <= 2012 native graphing options are a joke! ~ If you can use SSRS 2016, they may have fixed a lot of those customization options.
What I have tried:
Every possible combination/settings workarounds you can think of and unlimited coffee googling to the max. If you are barely starting this journey to figure it out. Let us save you hours of research and stress so you can meet your deadlines. Either build the design in broken up graphic portions (considering that SSRS will render based on borders). If you can crop images do that as much as you can; I found Windows 10 Paint 3D to be very helpful with that, Out of everything I tried, cropping/breaking apart images was the best alternative to get a better level of customization.