• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

ADDATTRIBUTE value

ollyau

Resource contributor
Messages
1,039
Country
us-california
Hi Arno,

Is it possible to add a command to scenProc to generate a new GUID? I'm interested in creating shp2vec scenery from OSM, and I think generating a GUID for the UUID field would be thing needed besides what already exists. I think something like this would suffice:

Code:
IMPORTOGR|C:\Transfer\hawaii-latest.shp\roads.shp|*|*|NOREPROJ
ADDATTRIBUTE|FTYPE=LINE|Uuid|NEWGUID
ADDATTRIBUTE|FTYPE=LINE;type=tertiary|Guid|{FC0B904B-8777-4686-B387-FF8042DA3D15}
ADDATTRIBUTE|FTYPE=LINE;type=trunk|Guid|{0BEE1D28-A5B7-4E6A-9C9F-260C03DCFF8A}
ADDATTRIBUTE|FTYPE=LINE;type=motorway|Guid|{5DD1FA52-E283-43DD-A588-EB077AA5A38F}
EXPORTSHP|*|RDXHawaii

Where NEWGUID is the proposed new command.

Also, on an unrelated note, is it possible that you target .NET 4 instead of .NET 3.5? Windows 8 (and 8.1) doesn't ship with versions of .NET older than .NET 4, and it would be convenient to be able to use your tools without installing older versions of the framework. (.NET 4 is still compatible with Windows XP, whereas .NET 4.5 is not.)

Thanks!

Orion
 
Hi,

If I remember correctly there is a step called ASSIGNUUID that does what you want with the guid.

Moving to .NET 4.0 is probably not possible at the moment. I'm using a build server that automatically makes the releases and for that server I don't think .NET 4.0 is available already (it's using mono on Linux).
 
Hi Arno,

Is it possible to add a command to scenProc to generate a new GUID? I'm interested in creating shp2vec scenery from OSM, and I think generating a GUID for the UUID field would be thing needed besides what already exists. I think something like this would suffice:

Code:
IMPORTOGR|C:\Transfer\hawaii-latest.shp\roads.shp|*|*|NOREPROJ
ADDATTRIBUTE|FTYPE=LINE|Uuid|NEWGUID
ADDATTRIBUTE|FTYPE=LINE;type=tertiary|Guid|{FC0B904B-8777-4686-B387-FF8042DA3D15}
ADDATTRIBUTE|FTYPE=LINE;type=trunk|Guid|{0BEE1D28-A5B7-4E6A-9C9F-260C03DCFF8A}
ADDATTRIBUTE|FTYPE=LINE;type=motorway|Guid|{5DD1FA52-E283-43DD-A588-EB077AA5A38F}
EXPORTSHP|*|RDXHawaii

Where NEWGUID is the proposed new command.

Also, on an unrelated note, is it possible that you target .NET 4 instead of .NET 3.5? Windows 8 (and 8.1) doesn't ship with versions of .NET older than .NET 4, and it would be convenient to be able to use your tools without installing older versions of the framework. (.NET 4 is still compatible with Windows XP, whereas .NET 4.5 is not.)

Thanks!

Orion

Hello,...

not sure,.. what you mean by not shipped with....

but all previous versions of the .NET framework are already within Windows 8/8.1,.. the only one that is not is actually 1.0,... they just have to be "clicked" or turned on, so to speak.
 
Last edited:
ASSIGNUUID seems to be recognized by scenProc (it becomes highlighted purple), but when viewing the resulting DBF file, it seems that scenProc enters the string "ASSIGNUUID" instead of a new GUID.

I'm not sure how your build server is set up, but it sounds like Mono supports .NET 4 (see here and here).

Perhaps shipped with isn't the best wording. I know it's possible to enable through the "Turn Windows features on or off" control panel applet, but I'd prefer to avoid doing so if possible.
 
Works fine here with a configuration like this, all features get a Uuid field added to them:

Code:
IMPORTOGR|myfile.shp|*|*|NOREPROJ
ASSIGNUUID
EXPORTSHP|*|test

Yes, Mono supports .NET 4.0, but my little home server is running an older Debian version and I am not sure if for that version the latest Mono is available.

And I still use Visual Studio 2008 for my development as well, don't think that version supports .NET 4.0. I would have to check if the Visual Studio plugin I bought also works for never versions.

So there are some things to check before I can move to a newer .NET version. But they are not highest on my priority list, I prefer to spend time on the tools, instead of on my development environment :)
 
Oh, it's a standalone step. Works well now, thanks. :)

For what it's worth, I was previously trying to use it like this:

Code:
ADDATTRIBUTE|FTYPE=LINE|Uuid|ASSIGNUUID

Ah, I see. It's not a big deal, I was just wondering, as it would be a little more convenient. :p

Edit: Actually, is there a way to only ASSIGNUUID for particular features? (e.g. have a filter parameter similar to ADDATTRIBUTE?) I'm getting a whole bunch of shp2vec warnings, and I think they pertain to having a UUID for a feature without a GUID for the associated scenery element.

Edit 2: Or alternately, can there be a step to remove shapes by name or attribute?
 
Last edited:
Hi,

I can add a filter to the ASSIGNUUID step. That would make sense. I just didn't needed it when I first made this step :)
 
Just had another thought about it. Maybe add a special name NEWGUID to ADDATTRIBUTE as you suggested initially is more generic. So I'll do that I think :)
 
Hi,

I have made the change now. So from the next release ASSIGNUUID is deprecated and in ADDATTRIBUTE you can use NEWGUID as value to get a new random GUID as value.
 
Back
Top