0

Hi i am trying to build AR App in Xamarin.iOS, to get my custom 3d model displayed i neede to use ModelSceneSymbol and also publish my custom 3d model into arcgis by zipping it, so that later in runtime i can unzip it and use it.

To complete the Constructor it takes two parameters 1) Uri and the second one is scale factor arcgis has used datamanager to return the uri by calling the getdatafolder which takes the parameters(the id of the uploaded sample and the name of the 3d model) it later calls sample info and uses 3 different files to store and display the model on the map.

when i tried to import this i found out that it can't be called so i copied all the files created classes and called it, by fixing a lot of errors i have called the exact id code of the sample and name of the sample displayed in this example https://developers.arcgis.com/net/ios/sample-code/animate-3d-graphic/

but still i keep getting errors and the most important one System.IO.FileException-File not found

can anyone help me with debugging it i am providing datamanager code here

https://github.com/Esri/arcgis-runtime-samples-dotnet/blob/main/src/ArcGISRuntime.Samples.Shared/Managers/DataManager.cs

H99C1
  • 35
  • 7
  • The datamanager is very specific to make that sample app work with multiple samples - you don't at all have to use that. Just load the files onto your device (or download with http), and points to them. Note that the Uri can be a file path too. – dotMorten Jun 02 '22 at 16:30

1 Answers1

1

Great to see that you are using our AR functionality.

DataManager is a utility only meant for use in the sample viewer. It is not very portable. I recommend writing your own data download code. We use attributes to determine what data is downloaded for a sample. The viewer downloads the data when a sample is opened. All portal items are downloaded in this method. You could modify the DataManager class to work without SampleInfo, then verify that it downloads your item to your intended folder.

A different solution could be including the model in your app as a bundle resource. You could skip the online workflow and access the file locally with Path.Combine(NSBundle.MainBundle.BundlePath, "YourPath").

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
  • great this helps a lot, could you please include this in the documentation it would be really helpful – H99C1 Jun 03 '22 at 03:41
  • can we just upload the 3d model to glitch assets and copy the stand alone link and use that uri? – H99C1 Jun 03 '22 at 03:47
  • Yup you need a file uri or a web uri. Either will work – dotMorten Jun 03 '22 at 20:11
  • i tried it with glitch uri but the model wasn't displaying on the scene, thought it would take time to load because the model might be too large but that wasn't the case, even after w8ing for 20 minutes – H99C1 Jun 05 '22 at 03:39