question

feng W2 avatar image
0 Likes"
feng W2 asked feng W2 answered

Change Astar Barrier properties with code

How to modify the length and width properties of Barrier in Astar with code so that the modified length and width properties can be displayed in the 3D model

FlexSim 19.0.0
astar navigator
· 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.

Wang Yang avatar image Wang Yang commented ·

In order to solve your problem better and faster, you can contact our local China partner (BJCSN), we will provide you with professional FlexSim technical Q&A. contact information: [email protected]; QQ:1093796825;Thanks

-1 Like -1 ·
feng W2 avatar image feng W2 Wang Yang commented ·

I aslo asked this question on the BJCSN,Thanks

0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Jacob Gillespie commented

I have found a related question about adding new barriers to AStar. There @Matt Long pointed out that a change gets executed after a reset of the model. If you intend to change barrier sizes dynamically while running the model, I assume it won’t work, because you can’t reset partly nodes in the tree.

· 8
5 |100000

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

feng W2 avatar image feng W2 commented ·

treenode barrier = createinstance(node("/astar/Barrier",library()),model);

I have generated barrier with that code and modified the barrier's length and width,however,the modified barrier in 3D model is not changed,and still the same.

So i want to get a way to modify the shape of barrier.

Thanks!

0 Likes 0 ·
Jacob Gillespie avatar image Jacob Gillespie ♦ feng W2 commented ·

@feng W2

Using createinstance() is the correct way to add a barrier now.

Here is how you would create it:

treenode barrier = createinstance(node("/astar/Barrier",library()), node("AStarNavigator", model()));
function_s(barrier, "setPointCoords", 0, 0, 0, 0);
function_s(barrier, "setPointCoords", 1, 10, 10, 0);
1 Like 1 ·
feng W2 avatar image feng W2 Jacob Gillespie ♦ commented ·

Thnak you vary much! It is so helpful to me!

0 Likes 0 ·
Show more comments
feng W2 avatar image
0 Likes"
feng W2 answered

@tanner.p@Jacob Gillespie Thank you vary much!

5 |100000

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

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.