Results 1 to 7 of 7

Thread: Vissim Data to Lightwave?

  1. #1
    Super Member SteveH's Avatar
    Join Date
    Feb 2003
    Location
    Albuquerque
    Posts
    477

    Vissim Data to Lightwave?

    HI everyone. I'm trying to get Vissim data - that figures out how cars move through an intersection or roadways into lightwave. In Vissim you can export out a file that Excel reads and export out a comma separated file. You can export out of Excel as a text file. This says at lets say 5 seconds car #1 is at these coordinates, at 6 seconds it's at these coordinates etc. And....that's as far as I get. Now what do I do with that information? Keep in mind I might have hundreds of cars over several minutes. Do I somehow bring that data into a scene file that's opened in Notepad or....save each car out somehow to a motion file that's then brought into Layout? I'm still using 2015.3 if that matters.

    I've opened a scene file and a motion file in Notepad and I can see where there are keyframes - although I'm not exactly sure what I'm actually seeing format wise.
    Apparently it's no problem with Max but no way I'm going that route! 7 or 8 years ago I worked with Al Street to do this but I don't know if he's still around and involved in Lightwave. Any ideas would be most welcome.
    Somewhere between the Darkness and the Light

  2. #2
    I can't recall what keframe data looks like in a lws file but when accessing it via python there are values associated with time, the channel, the value at time and then the type of keframe (stepped, linear, etc). You could do what you want via python.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  3. #3
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,795
    You could try modifying Mike Green's CSV (comma separated value) importer to read the Vissim data. The LScript is available here:

    https://www.lightwave3d.com/assets/p...ry/import-csv/

    which, according to the comments:

    // This script imports position data from a text file of the form
    // minutes:seconds,X,Y,Z and applies it to the selected item.

    According to the sample Vissim data here:

    https://github.com/wenfuwang/ParseVissimFzpRsr

    in the .fpz file, the data format of this particular Vissim data is:

    $VEHICLE:SIMRUN;SIMSEC;NO;POS;COORDFRONT;LANE\LINK ;LANE\LINK\ISCONN;LANE\INDEX

    using semicolons as field separators, with the first line being:

    7;900.10;967;81.65;1516.439 1047.556 0.000;4;0;3

    So, if I interpret this correctly:

    7 = $VEHICLE:SIMRUN
    900.10 = SIMSEC
    967 = NO
    1516.439 1047.556 0.000 = POS (In LW coordinates, probably X,Z,Y or Z,X,Y, 0 being "altitude")
    4 = COORDFRONT
    0 = LANE\LINK
    3 = LANE\LINK\ISCONN

    and there doesn't appear to be a value for LANE\INDEX.

    It's IMPORTANT TO NOTE that the CSV data you receive / export from your pipeline may have a different data format than the sample data referenced above. You'd need to look at the header with the data description (as above) to ensure you're getting the right fields.

    I don't have time to modify the LScript myself, but it might be fairly easy to modify the LScript to ignore the header data down to the first data record, skip the irrelevant information in each record (only using the SIMSEC and POS data would be my guess) and creating keyframes for the car.

    Good luck!
    mTp

  4. #4
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,795
    Oops - missed a field - 81.65 is the POS, 1516.439 1047.556 0.000 is the COORDFRONT, then the three single digits are the LANE stuff.

    That's why I write programs to interpret data!

    mTp

  5. #5
    Super Member SteveH's Avatar
    Join Date
    Feb 2003
    Location
    Albuquerque
    Posts
    477
    Thank you both for the quick replies. Unfortunately both of them are above my knowledge base (I be dumb as a rock). Monday I'll see if one of our IT guy knows Python. I'm pretty sure he does. If not I'll read up on scripting and see what's involved. I'm positive the Vissim guys can edit in excel to get just the fields Lightwave needs. I'll let you know how it goes. Thanks again for you help guys - I appreciate it.
    Somewhere between the Darkness and the Light

  6. #6
    Converting your data into the format that Mike Greene's lscript expects should definitely be possible. Doing that via a python script would be very easy if you can figure out the translation of data.

    Problems like this are good motivation to learn a skillset like scripting.

    Can you post an example of your data along with a breakdown of how to read the data?

    - - - Updated - - -

    Converting your data into the format that Mike Greene's lscript expects should definitely be possible. Doing that via a python script would be very easy if you can figure out the translation of data.

    Problems like this are good motivation to learn a skillset like scripting.

    Can you post an example of your data along with a breakdown of how to read the data?
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  7. #7
    Super Member SteveH's Avatar
    Join Date
    Feb 2003
    Location
    Albuquerque
    Posts
    477
    I apologize for not replying sooner - work got in the way. I did find success finally with a plug in that Al Street made for me years ago. The fzp file worked fine. In Excel it had to be sorted by Vehicle number, then by time, and then saved back out of Excel as a fzp file (attached). The format of what each row is shown in the Excel capture if anyone one to give it a try using Mike Green's lscript.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Excel_Capture.PNG 
Views:	17 
Size:	69.0 KB 
ID:	144389  
    Attached Files Attached Files
    Somewhere between the Darkness and the Light

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •