Jump to content

Model entities from other models


JordiB
 Share

Recommended Posts

Hello everyone,

 

First time here! I'm trying to combine 2 different models in the same file, the model on the left will create the model entities (colored dots below the model) and send them to the model on the right through the node OUT2, then, on the right model, the vehicle will pick the entity and decide its destination depending on the type of entity, the issue here is that the right model can't identify the entity as it's created on another model and will be called "Model1.Entity" instead of "Entity", i don't know how to ignore the "Model1."part.

 

image.thumb.png.226a97dad48181169e918e3746c6ac4f.png

 

I've tried to use model entity's state variables, hoping to be able to read them with the expression "ModelEntity.NameOfVariable", but i can't seem to assign values as it says that "Specified name was not found".

image.thumb.png.1ae6498e166494b01db965cfd8be5c9c.png

 

Fusing both models in the same model it's not an option as i want to be able to make different configurations.

 

Thanks!

CONFIGURADOR.spfx

Link to comment
Share on other sites

Ok!

Seems like i figured it out:

 

The left model was Copy-pasted form another file and the model entity it used wasn't the one you can see on the top right of the screenshot (previous post), i had to convert all model entities from the left model to the one on the file (highlighted below), this is also why i had the error "Specified name was not found" from the previous post as the model couldn't find the variable from the model entities it was using.

image.png.3f7debc752b39d9504eaa89c07697f31.png

 

Once done i could create a state variable on the ModelEntity1's definition tab and read that value on any model using "ModelEntity1.NameOfTheVariable". 

Link to comment
Share on other sites

×
×
  • Create New...