How to create a 3D view just like BimViews using Java? - ifc

I am new to the plugin development of BimClientServerLib.
I have to create a plugin/service where i just need the 3D view and get all the information, so that if i push some information like simulate Door_1 it should be highlighted in the 3D View.I have used the [BimServerClientLib] to check in the project and retrieve some information like get all levels or get all detectors with existing BimViews as 3D viewer and the BIMServerClientLib as a separate Java service.Also, if i use the BimViews which is in Java script how do i push information with the service in Java.

Have a look at BIMSurfer. Download the project into any server (like tomcat), then navigate to the index.html. They have two examples, local one without a BIMServer and another with a connection to BIMServer.
You can adjust their BIMServer example to load your project and for highlighting a specific element, you can the provided library methods (available on the BIMSurfer github main page).
bimSurfer.setSelection({ids: ["object3", "object2", "object4", "object6"], selected: true });
Goodluck.

Related

How do you flip whole Docs horizontally 180* with the CSS command rotateY(180deg)?

I can get basic html text to flip 180*, but I'd like to know how to get a whole Doc in my Drive file to flip using a standalone script (so I can do it repeatedly). I'm aware I can get a doc, open the scripts editor and then use my flippin' project to flip the doc I called, but I don't know what the syntax looks like. My first flippin' success was pasting text into the .html file as simply as possible and using:
function doGet() {
return HtmlService.createHtmlOutputFromFile('Page');
getContent()
}
I just test ran it from the dialog box as a web app. But I'm interested in building this one command feature out into several different domains to get experience with the variety of possibilities available in GAS. Anyone care to tutor me? Please?!...

Get project ID without using training module on custom vision?

I'm using the Custom Vision API and the sample I found out on github / docs included the training and creation of a project. However, I have done the training and creation part online (http://customvision.ai).
Now in order to predict the image, I need project ID.
endpoint.PredictImage(project.Id, testImage);
Where can I get this one from?
I am only interested in using the Prediction API without having to train from my code.
Your thoughts please.
The simplest way to get the project url from the website is to open the project in a browser and look at the URL; the project id is the GUID listed after /projects: customvision.ai/projects/<ProjectID>#/manage
Or you can call TrainingApi.GetProjects() to retrieve a list of ProjectModel objects, and get the project id you need by checking its properties (like Name or Description).

Problems with Graphhopper application

I am trying to make an map with Graphhopper but after I choose and load the map completely on the screen, there are some problems, you can see in the pictures below:
When the map loaded
When I hold tap on the screen for routing
Why did this happen? and how to fix it?
Hard to figure out without logs, but i encountered a similar problem recently.
If you're in the same situation as i was :
This means that your berlin-gh folder does not contain the data relative to the EncodingManager your are trying to use.
First it is important to know which kind of EncodingManager you are using, they can be either of the following :
"foot","car","bike","bike2",etc...
Now let's say you want to get the foot path from one point to another on your map, then you must be building somewhere in your code your graph request :
GHRequest yourRequest(latitudeStart, longitudeStart, latitudeEnd, longitudeEnd);
yourRequest.setVehicle(EncodingManager.FOOT); // or .CAR, .LOL (lol)
These data are constructed by the graphhopper.sh script when you import the map of your choice :
edit the config.properties file inside the graphhopper folder
Vehicles #####
Possible options: car,foot,bike,bike2,mtb,racingbike,motorcycle (comma separated)
bike2 takes elevation data into account (like up-hill is slower than down-hill)
and requires enabling graph.elevation.provider below
graph.flagEncoders=foot
^ Put here your comma separated list of vehicle you want to support
now delete any folder created by graphhopper with previous attempts of import (otherwise the command below will fail)
then launch graphhopper.sh import "your map path"
At this point it should have created the (let's say) berlin-gh folder with the support for the vehicle you chose.
Put this folder in your application (wherever you load it) and now you can configure your graphrequest to load paths for the encodingmanager of your choice.
Hope i'm clear enough.

How I can include the use of the extension deck.automation.js when I create a document Rmarkdown-slidify-deck.js in RStudio?

How I can include the use of the extension deck.automation.js when I create a document Rmarkdown-slidify-deck.js in RStudio? It is to show a presentation on a screen with statistical content without interaction from anyone, and when finished will start automatically.
https://github.com/rchampourlier/deck.automatic.js
http://ramnathv.github.io/slidify/index.html
Here is a demo of how to add this extension to deckjs, while using Slidify. In short, here is what you need to do.
Use author("mydeck") to initialize deck, change framework to deckjs and run slidify("index.Rmd")
Download the extension automatic and add it to libraries/frameworks/deckjs/extensions.
Modify libraries/frameworks/deckjs/config.yml so that automatic is added to the list of extensions.
Modify libraries/frameworks/deckjs/partials/snippet.html, so that the javascript snippet required to initialize the extension is added.
You can also add an option for Play/Pause, as well as set custom slide durations. Instructions are in the slide deck here.
UPDATE: The instructions here assume that you have the dev branches of Slidify and Slidifylibraries installed.
pkgs <- c("slidify", "slidifyLibraries")
devtools::install_github(pkgs, "ramnathv", ref = "dev")

push external multimedia file in to package at tridion publish time

When we publish some page/dynamic component from tridion is it possible to add some external multimedia file/content(ex:jpg image) in to current executing/rendering package at publish time.So that final transportation package has this binary file present along with original published content?
Is this achivable using customization of tridion renderer/resolver?If yes please provide some inputs.
*Note:*The binary content that needs to be pushed in to package at publish time is not present as multimedia component in tridion, it is located at other file location outside tridion CMS.Instead we have some stub multimedia component being used inside published component/page which has some dummy image. we plan to replace the stub image with original image at publish(rendering/resolving) time.
Since we have huge bulk of binary content stored in DAM tool we dont want that data to be recreated as multimedia component in tridion, insted we want to use that data by querying DAM tool and attach it in to tridion package with some logical referencesplanning to maintain one to one mapping between stub multimedia comp tcmid to original content in some mapping DB for reference).
Please let us know if any solution is there to attach external binary content to package at publish time.
The best - and easiest way - is to use the mechanism provided by Tridion out-of-the-box for this. Create a new multimedia component, select "External" in the resource type drop-down, and type the URL to the object. As long as you can address it with a URL, it will work exactly as you want (item will be added to package and sent to delivery server).
If this is not good enough for you, then yes, you can add it to the package yourself. I've done this in the past with code somewhat like this:
FileInfo file = // Weird logic to get a FileInfo object from external system
Item item = package.GetItem("My original Item");
item.SetAsStream(file.OpenRead());
This replaced the content of my original component with the actual file I wanted. This will work for you IF the original component is also a multimedia component. If it's not, just create a new item with your own name, etc. If possible, do use the out-of-the-box process instead.
PS: FileInfo Class.
As Nuno suggested the best way is to use multimedia component with 'External' resource type. You may not need to create these manually, you can automate using core services or API programs.
Another way I used before to create zip file at run time and add same to package with following code. Hope it may help.
using (MemoryStream ms = new MemoryStream())
{
zip.Save(ms);
downloadAllInOneURL = String.Format("ZipAsset{0}.zip", uniqueZipID);
downloadAllInOneURL = m_Engine.PublishingContext.RenderedItem.AddBinary(ms, downloadAllInOneURL, "", "application/zip").Url;
downloadAllInOneSize = getSize(ms.Length);
}

Resources