question

Martin K5 avatar image
0 Likes"
Martin K5 asked Martin K5 commented

ControlPoint creation problem.

Hi,

I am trying to create ControlPoint by code. The thing I want to make is to create ControlPoint in the same way as I can do manually by dragging the controlPoint and placing it exactly on the created Path, in this moment the controlPoint will have little cross inside him (a visual mark that the controlPoint lays exactly on the path). When I do this by code (creating an instance) and setting up the location of that controlPoint to be on the same path, but here the problem occurs. The controlPoint has the y-location as the path does, but the little cross does not appear. Only after moving manually with the controlPoint the little cross appears. I am dealing with this because I am creating the whole model by code and then the AGV network does not work because the controlPoint is not "connected" properly and you need to move it as I said a little and then the cross appears and everything works fine. I have attached the model with script to see what I meant.

Did anyone deal with this problem?

Thank you.


cp_pokus.fsm

FlexSim 21.1.4
codecontrol pointspath
cp-pokus.fsm (28.8 KiB)
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

·
Roi Sánchez avatar image
0 Likes"
Roi Sánchez answered Martin K5 commented

Try to run this line of code after creating the control point, where the first argument is the control point treenode:

function_s(controlPoint, "finalizeSpatialChanges");


· 3
5 |100000

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

Martin K5 avatar image Martin K5 commented ·
Hi,

yes, I tried this code in the model that I attached and it works nicely. But when I try it in the bigger model it does nothing, but I has the same structure as I have here. What I do there is to create instance of the Control Point, set his location to be on the path that I want, then I create the connection to the rack and than I applied the code that you posted and it is still without the crossing and the AGV network does not work.

Thank you,

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Martin K5 commented ·
@Martin K5 Can you attach a sample model that demonstrates the issue?
0 Likes 0 ·
Martin K5 avatar image Martin K5 Matthew Gillespie ♦♦ commented ·

When I used this line of code in another script (with finding the object that I want to finalize), it does work.

Thank you

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.