Can alignment landxml data import with grasshopper scripts?

Hello, everyone

I would like to ask you a question concerned with the grasshopper scripts. I have the data of landxml ( alignment and profiles are included). I would like to import this data into rhino, using grasshopper scripts. I also tried the scripts of the Bison add in but I cannot be able to import my landxml data. Is there any add in or scripts I could try? If you have any better ideas, could you explain it to me to be able to import my data.

Have a good day, everyone!
Thanks for supporting!

Hi @EiZin,

You can convert the xml files to json, with JSwan and then use the read JSON components to extract the geometry data.
https://www.food4rhino.com/en/app/jswan
or you could try Heron (via package manager)

1 Like

Hello,

When I tried the Heron package, Import Vector, I got the error message as shown in the picture below. Is there any setting or component that I could try? I also tried JSwan component to change xml to json file.I got the error message like the attachment picture.

How could I continue to be able to see my landxml file?

Thanks a million for supporting! Have a good day!

You could try the native read file component from grasshopper, and have a look into what it looks like. XML is generally wel readable.
Or use Notepad.

Hello,

Is there any alignment Landxml data sample that you could share it to me? If it is possible to share with gh scripts, I will be happy. I also tried with the native read file component but my alignment data cannot be found at rhino view. Thank for sharing
information concerned with Notepad. I will also try it.

Thanks again for supporting! Have a good day!

Hello,

I tried another alignment landxml data and It can be changed to Json file. I extracted the Json data with Deserialize Json component. I did not know how could I get the preview at rhino using the extracted Json data. Is there any component that I could try? If you have any good ideas, could you explain it to me? Thanks for supporting a lot!

Hi @EiZin,

You will need to unpack the Json, and look what is in there. Landxml is quite complex structured.
If you want an easier way you could try/buy this plug-in: https://www.food4rhino.com/en/app/endpoints
Below you can find an example of how to convert the landxml text file to geometry.

landxml.gh (241.6 KB)