Help: Error in Create Object

Help: Error in Create Object

ABajpaiWMKNX
Enthusiast Enthusiast
491 Views
15 Replies
Message 1 of 16

Help: Error in Create Object

ABajpaiWMKNX
Enthusiast
Enthusiast

[ FlexSim 23.1.1 ]

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

0 Likes
Accepted solutions (1)
492 Views
15 Replies
Replies (15)
Message 2 of 16

jason_lightfoot_adsk
Autodesk
Autodesk

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

Message 3 of 16

ABajpaiWMKNX
Enthusiast
Enthusiast

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
Message 4 of 16

jason_lightfoot_adsk
Autodesk
Autodesk
Accepted solution

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

Message 5 of 16

ABajpaiWMKNX
Enthusiast
Enthusiast

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
Message 6 of 16

jason_lightfoot_adsk
Autodesk
Autodesk

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

0 Likes
Message 7 of 16

jason_lightfoot_adsk
Autodesk
Autodesk

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

0 Likes
Message 8 of 16

ABajpaiWMKNX
Enthusiast
Enthusiast

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?

Image.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).

Image.png


Image.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.

Image.png


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


0 Likes
Message 9 of 16

jason_lightfoot_adsk
Autodesk
Autodesk
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?

Message 10 of 16

ABajpaiWMKNX
Enthusiast
Enthusiast

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
Message 11 of 16

jason_lightfoot_adsk
Autodesk
Autodesk

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.

Message 12 of 16

julie_weller
Not applicable

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 🙂

Message 13 of 16

ABajpaiWMKNX
Enthusiast
Enthusiast
Thank you for explaining! So technically speaking, i could create any name for that label (apart from "addedparts")?
0 Likes
Message 14 of 16

julie_weller
Not applicable
Yup! And it would create an array for you
Message 15 of 16

ABajpaiWMKNX
Enthusiast
Enthusiast

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
Message 16 of 16

jason_lightfoot_adsk
Autodesk
Autodesk

You run the model as is, or add a source and combiner to get all the parts into the correct chassis flowitem.

Move any incorrectly positioned components to the correct locations

Right click the chassis in the model containing those flowitems, and set it as so().

Edit the script so that it will update the correct chassis in the flowitem bin.

Run the script.