Heron Import Vector with Hops

Hi @andheum

Sorry it is me again. I tried to build in the the Import vector component into a Hops function. Unfortunately it give an error. Could it be that this is not possible yet? Or do I have to ask @stevebaer what is gooing wrong here?
Import Vector Hops.7z (109.0 KB)

I believe @Brian_Washburn is the author of Heron

Hi @stevebaer ,
I’m having a hard time troubleshooting this. I’m not sure what the error means that Hops is throwing.

  1. Solution exception:Object reference not set to an instance of an object.: component “ImportVector” (49d46bb6-87e9-4c5b-b842-f7afc305d354)

I’ve added another Heron component to the Import Vector test_BW.gh which does seem to work. Also using the same ImportVector setup in the main GH file works.

Hops_BW.gh (13.2 KB)
Import Vector test_BW.gh (8.5 KB)

-Brian

Do you use RhinoDoc.ActiveDoc at all in your components? No docs exist by default when running headless on compute and that is typically the issue.

Yes, I use it in ImportVector to get the EarthAnchorPoint, the document tolerance and units.

@Erik_Beeren I’ll look into making a version of the component that doesn’t use ActiveDoc, but it will not be able to crop the data with a boundary or scale it and may not be able to use SetSRS.

-Brian

1 Like

@Erik_Beeren I’ve created a stripped down version of Import Vector called Import Vector Lite (IVL) which works with Hops by avoiding calls to RhinoDoc.ActiveDoc. The data comes in raw meaning the EarthAnchorPoint, the model’s units and Heron’s SRS have no effect and geometry will usually end up pretty far from origin. I also needed to drop the boundary input, so the data cannot be cropped and all of the data will come in at once. For larger data sets, the import may take some time.

This component will be included in the next Heron release (v0.4.2).
-Brian

Sorry, my mistake. Thank you for this remark @stevebaer.

Thank you @Brian_Washburn for diving into this. There where two reasons why I was trying to run the script via Hops.

  1. I would like to run the script via grasshopper player and in order to test it I used hops. In Hops it does not work but using the grasshopperplayer it works perfect. I guess this is because of RhinoDoc.ActiveDoc.

  2. It would be nice to read multiple files through one “import vector” node. For example: For getting all the data of the 3DBAG in a certain boundary sometimes more tiles of the 3dBAG are needed. Sometimes 2 sometimes 3 or 4. Now I have to split the data into different streams, because otherwise to data of the different files gets mixed up.
    import vector multitrhread.gh (17.2 KB)

I thought by using HOPS the script could run in paralel so the problem would not exist. But as I see it now, the disadvantages of not being able to use the RhinoDoc.ActiveDoc do not outweigh the advantages.