question

Julio R avatar image
1 Like"
Julio R asked Jason Lightfoot edited

Problem creating GIS points with code

Hello,

I have been working on a model to create a logistical network. For this I need to create all my points.

Since it was taking too long and I wanted to know if the system was working I did it in processFlow so it will create a point each second (not important for this question, just explaining why is not in a for cycle in a script).

My problem now is that once I press reset the coordinates changes to 0,0. The strange thing is that when I use another code using the same commands after everything is in 0,0 coordinates, everything goes where is supposed to and stays there even after restarting the model. (this code is on a script)

My first question is, how can I update my code so I don´t have to run the second one after restarting the model?

My second question is, is there a better way to do this?

And finally and less important, why does it take so long to create the objects in a code? I tough that it was taking a long time because it had to create the conexions and had to pull the data, but when I move them everything is very fast.

This is a simplied version of the model:

Network position proof of concept_1.fsm

FlexSim 22.0.1
codegis
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

Instead of setting the property for longitude and latitude if you use setvarnum the location will stick:

    setvarnum(point1,"latitude",tablaClientes[filaCliente][2]);
    setvarnum(point1,"longitude",tablaClientes[filaCliente][3]);
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Julio R avatar image Julio R commented ·

Thank you @Jason Lightfoot

I tried that but now it is just putting everything in coordinates 0,0, even before pressing reset.

Am I doing something wrong?

Network position proof of concept_2.fsm

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Julio R commented ·

You need to match the case in the code snippet - it's all lower case. You can just copy/paste the code above.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.