question

Abhay Bajpai avatar image
0 Likes"
Abhay Bajpai asked Jason Lightfoot edited

Help: Error in Create Object

Getting error at "Create Object". And i don't know what else to do. I have tried everything. I have attached the model with it. Can someone help me understand why this error is being caused?


Champion Homes V1_1_autosave.fsm1686169444736.png

FlexSim 23.1.1
create object
· 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.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

This has diverged from the initial concept a bit. Let me review the previous models and see how to get back on track.

1 Like 1 ·
Abhay Bajpai avatar image Abhay Bajpai Jason Lightfoot ♦♦ commented ·

Yeah i took your previously posted models (cycle time database AND Part Maps) and combined them together from my understanding of what you did in yours. Some variables are different in mine. Appreciate any help Jason.

0 Likes 0 ·

1 Answer

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Jason Lightfoot edited

It looks like two example models have been combined 'incorrectly'.

In one of the models we had this station process to set up some maps for the stations:

1686171270199.png

An in another we had a map for the locations of parts on the station that we were using when a chassis arrived:

1686171360091.png

The way to combine these model is not to change the source type :

1686171546154.png

but to instead either have seperate initialization and part creation process flows, both of which the station would be a member - or put them in the same process flow.:

1686171806455.png


In your latest upload the expression for the part to create is incorrect. It was

Model.find("Tools/FlowItemBin/"+current.partMap[creationRank]+"/1")

but we've now got model based part list so we need to find the array if parts using

current.partMap.as(Map)[token.item.modelID]

But it looks like you didn't have a label for modelID on the chassis - I've added that.

There were many things that needed fixing - too many to list here. The main issues were:

  • mismatching cases (labels and also the partIDs and part table 'SideWall' vs 'Sidewall')
  • inconsistent label names
  • removal of "/1" from paths that needed it.
  • moved to version3.1 which doesn't like assigning an array to a Vec3 type (location and rotation)


Revised model attached.

champion-homes-v1-1_060723a_jl.fsm


· 12
5 |100000

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

Abhay Bajpai avatar image Abhay Bajpai commented ·

I changed the source type because I did not have the Source in 3D model like you did to introduce the chassis. Attached is the model you first made. I changed my initial model that did not have Source in 3D model to the one that looks like right now.

buildingassemblyline (2).fsm1686172204367.png

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Abhay Bajpai commented ·

Understood - but hang on I'll keep updating the post as I progress.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Abhay Bajpai commented ·

Finished updating the post - let us know if you have questions.

0 Likes 0 ·
Abhay Bajpai avatar image Abhay Bajpai commented ·

Follow-up questions: Q1. How do i print the "Model.find("Tools/FlowItemBin/"+token.parts[creationRank]+"/1")" to see its value? I am trying to understand what creationRank means.

Q2. What does the "/1" at the end mean?

1686234520273.png


Q3. I see the objects in 3-D model but cannot see any tokens in Process Flow. But when i remove "+/1" (from the previous question) I can now see the tokens but cannot see anything being added to the 3-D model (see pictures below).

1686234666019.png


1686234861702.png

When i added +"/1" back to the place, the tokens are gone from process flow and now i get an error saying that it could not find "M1_Floor_A1". Which is why i removed the extra "1" at the end in my previous model to make it work but did not go anywhere with it.

1686235090625.png


champion-homes-v1-1-060723a-jl_autosave.fsm


0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Abhay Bajpai commented ·
creationRank is just a number telling you which of n tokens it is. If we create 3 tokens, then each will have different creationRanks numbered 1,2 and 3.

You can print the string within the find() method - just use the whole string expression.

The /1 just means the first subnode under the path to the left of the /. It's useful because you don't need the name which in our case would be concatenating the partID twice.

The tokens get created and destroyed during the events - there's no need for them to persist - but you can disconnect the sink or place breakpoints in the expressions if you want to inspect the labels. Just keep in mind that when stopping at an event you want a breathe or delay of 0 seconds after the token's activity in order to step and see the token move through the process.

I'm not sure about you adding "/1" anywhere in the model - I uploaded it working. Do you mean when trying to set up the part locations for a different model?

1 Like 1 ·
Abhay Bajpai avatar image Abhay Bajpai commented ·

Hi Jason, how did you get "token.addedParts"? I searched everywhere i could but could not find the label "addedParts" anywhere. Is this a custom label you created or is it something that is in-built in Flexsim?

1686678990033.png

0 Likes 0 ·
1686678990033.png (179.8 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Abhay Bajpai commented ·

That's the only place it's defined - it just creates an array of added parts if you needed references to them after the RunSubflow for each station's additions.

1 Like 1 ·
Abhay Bajpai avatar image Abhay Bajpai Jason Lightfoot ♦♦ commented ·

Thanks Jason! That makes sense. Whenever the parts get created almost all move but one object (M1_Sidewall_A) that is just created and won't move anywhere. I don't know what changed in your model but could you show me how can i use "so" to orient the objects created on the Chassis flow item?Jason'schampion-homes-v1-1-060723a-jl_autosave.fsm1686754229925.png

0 Likes 0 ·
Show more comments
Julie Weller avatar image Julie Weller Abhay Bajpai commented ·

Correct me if I'm wrong @Jason Lightfoot but I think that line is just creating a new label on the token and automatically adding it to an array that will keep track of added parts

This is a quote from the documentation for the Insert at Front checkbox:

"Insert at Front

If the Insert at Front box is checked, any data stored on the label or node that was passed into the Assign To box will remain and the new value(s) will be added to the front. This will cause the data to become an array with the most recent value as the first entry in the array."

Edit: Oops Jason just barely beat me to this post haha! Hopefully this can just be extra info now :)

1 Like 1 ·
Abhay Bajpai avatar image Abhay Bajpai Julie Weller commented ·
Thank you for explaining! So technically speaking, i could create any name for that label (apart from "addedparts")?
0 Likes 0 ·
Show more comments