ladybug-tools / spider-gbxml-tools

Scripts to help you view and manage gbXML files
https://www.ladybug.tools/spider-gbxml-tools/
MIT License
13 stars 3 forks source link

How to open a local file with script? #22

Closed EK-CEL closed 5 years ago

EK-CEL commented 5 years ago

Currently we have a C# Revit application which does the following:

  1. Exports Revit model to gbXML file,
  2. Makes some fixes
  3. Starts FZK Viewer to review the model quality.

Now I want to replace FZK with Spider. Sorry, I am not a programmer, but know some basics. Please suggest how can I open a local gbXML file in the Spider viewer automatically?

Thank you.

theo-armour commented 5 years ago

@EK-CEL

Click the question mark

image

Clicking should take you to this file:

https://www.ladybug.tools/spider-gbxml-tools/#sandbox/spider-gbxml-text-parser/r10/lib/file-open.md

The explanations are complicated but once you get the idea not difficult to put into your workflow

Please have a look at the text and help us make the concepts clearer and easier to get going.

Once we get going on this, I will move the file to a more up to date location.

EK-CEL commented 5 years ago

@theo-armour I try to follow the instruction:

Copy and paste a hashmark('#') followed by a file URI to the end of the link to gbXML Viewer in the address bar of your browser See Wikipedia [File URI Scheme]() https://en.wikipedia.org/wiki/File_URI_scheme )

I guess my link should be like this: https://www.ladybug.tools/spider-gbxml-tools/spider-gbxml-viewer/r15/spider-gbxml-viewer15.html#file:///C:/Temp/18330.1-M19.xml

I tried to put the file to our Intranet: https://www.ladybug.tools/spider-gbxml-tools/spider-gbxml-viewer/r15/spider-gbxml-viewer15.html#http://celoldintranet/departments/cad/video/test.xml

Nothing works for me with Chrome. Any suggestion? Thank you.

theo-armour commented 5 years ago

@EK-CEL @mdengusiak

My bad. I left out the necessary magic trick. 😢

Please see the updated version of this file. Also note new location.

Opening and loading files with gbXML Viewer

This release of the file has a new section you should look at titled 'Special note on using local files'.

All of this is a little bit complex. Please do help me to get the description of the process to get going as easy possible to read and act on. When you get these methods going you can save a huge number of clicks and keystrokes.

EK-CEL commented 5 years ago

@theo-armour

The instruction is good enough to understand and follow.

May be I am stupid, but after following your instructions I still cannot make it working. Should this work? image I input file:///C:/Temp/zz.xml into address line and browser (Chrome or Firefox) opens the file, but the address doesn't work: https://www.ladybug.tools/spider-gbxml-tools/spider-gbxml-viewer/r15/spider-gbxml-viewer15.html#file:///C:/Temp/zz.xml

What am I doing wrong? Thank you.

theo-armour commented 5 years ago

@EK-CEL

I have added three new items to the FAQ. I hope these help.

https://www.ladybug.tools/spider/#pages/file-open.md

EK-CEL commented 5 years ago

@theo-armour Thank you for the FAQ update. It clarifies something. I think that no need to input the file name in format file:///. The script converts the original file name correctly: image

Unfortunately the picture indicates that I cannot open the file, even the Chrome is started as required: image

(I gonna cry) :-)

theo-armour commented 5 years ago

@EK-CEL

(I gonna cry) :-)

Me too. I reset all my browser setting to default and now I also can't load local files from Maevia running on GitHub - though I can load local files when Maevia is launched from my computer.

Anyway, it's time to rethink the workflow because it's all getting too complicated. 😞

The objective is to minimize clicks and keystrokes. We want to be able to open a file using the file dialog box. go looking around for a file, make some changes, save it and then reload the file. But on this last step we don't want to go through the whole file dialog thing again

Spider gbXML Viewer 'Maevia' R15.23

image

It needs error checking, it needs to work with drag and drop.

What else does this feature need. Remember file used in a previous session (might be tricky to do)?


Re-reading your original request, the above is nice but does not solve your problem

So I will build a small HTML file of the Viewer that you can download. Running on your machine, this file should be able to access any local file. fingers crossed

theo-armour commented 5 years ago

@EK-CEL

Spider gbXML Viewer 'Maevia' Local

Local version: https://www.ladybug.tools/spider-gbxml-tools/spider-gbxml-viewer/r15/spider-gbxml-viewer15-local.html

Download this file ( Chrome context menu > 'Save link as...' ) to your desktop or wherever, follow guidelines for loading local files here Opening and loading files with gbXML Viewer in order to embed the Viewer in a local workflow and avoid CORS issues.

EK-CEL commented 5 years ago

@theo-armour It works! Thank you very much! BTW it accepts model file path in "standard" format, i.e. c:\Temp\zz.xml. There is no need using file:/// prefix. Please update the FAQ article.

theo-armour commented 5 years ago

@EK-CEL

It works! Thank you very much!

Yay, at last! We can stop crying now.

I'm sure there will be issues - and ways we can make the workflow even smoother. So do keep me pushing us for improvements.

BTW it accepts model file path in "standard" format, i.e. c:\Temp\zz.xml. There is no need using file:/// prefix.

Yes, thank you for showing me this!

Please update the FAQ article.

Will do. I will also add details about the local file and it's usage.

mdengusiak commented 5 years ago

I hope this works now. We moving on and I am closing this now.