Jump to content

ModelEntity State, can't create new one in old model


janikgagne
 Share

Recommended Posts

Hi All, 

I'm currently using a old working model and copy-pasted a process from another working model. The process uses a couple of assign using ModelEntity State variables. However when I recreate them in the model where I copied the process, I can't use them I always get an error (and orange box). Those State variables were working find in the old model.

Anyone knows why I can't copy them in another model ?

Tks to all.

Janik

Link to comment
Share on other sites

Hi, Janik! 

Thank you for using the Simio Forum.

First, if your logic uses any user-defined state variables, ensure that those state variables have been created in the new model (in ModelEntity > Definitions > States). 

If your problem persists, you may have copied the ModelEntity (and/or ModelEntity references) from your previous model, which may be the source of your error. In that case, you need to replace any references from the old ModelEntity to the new ModelEntity. You may be interested to know that you can right-click on the model object in the Navigation pane and select Object References > View to see if there are in fact competing ModelEntity definitions.

Best,

Alex

Link to comment
Share on other sites

Hi Alex, 

 

Thanks for the tip. However, even if i recreate the state variable and the process from scratch I always get "The specified name was not found" as an error from my Assign step even if i select it from the drop down menu of "State Variable" in the Basic logic of my Assign.

 

I'm trying other things right now ...  pretty sure it is a stupid mistake but can't see it for now :-)

 

Tks again

 

Janik

Link to comment
Share on other sites

Janik,

Okay, please let us know what the issue was when you discover it – now I am very curious. If you would like more assistance, please do not hesitate to reach out. Attaching some images of the assign-step logic and the error may be helpful if you do need further assistance. 

As always, best wishes with your modeling endeavors. 

Link to comment
Share on other sites

  • 2 months later...

I have the same issue. I want to insert a State assignment on the output of a separator. I see my state variable appearing in the list, so when I pick ModelEntity.variablename I immediately receive 2 errors: the name was not found and the repeating data has errors, this does not happen with a standard state variable like f.e. ModelEntity.Picture. Version is 10.174.16986

 

Thanks,

 

Jarek

 

image.png

Link to comment
Share on other sites

On 10/3/2018 at 11:56 AM, ResultLand said:

I have the same issue. I want to insert a State assignment on the output of a separator. I see my state variable appearing in the list, so when I pick ModelEntity.variablename I immediately receive 2 errors: the name was not found and the repeating data has errors, this does not happen with a standard state variable like f.e. ModelEntity.Picture. Version is 10.174.16986

 

Thanks,

 

Jarek

 

image.png

@ResultLand Care to share your model?

Link to comment
Share on other sites

13 hours ago, alexdmolnar said:

@ResultLand Care to share your model?

Hi Alex,

Thank you for replying. I unfortunately cannot share the model or a dummy model because of the confidentiality policy.

I eventually got to the problem, I copy pasted an entity from class ModelEntity from an old model into another new model. The name ModelEntity exists in my new model. The internal reference to the ModelEntity class however, is still pointing to the old reference, so not to the ModelEntity of the new model. So the copy pasted entity listens to all inherited functions and methods of the Entity class, but any custom statevariables etc. won't be recognised. 

So my question now is: How can I make the copy pasted entity point towards the correct ModelEntity Class Reference? 

Note: If you try to "Convert to type" your entity will lose all symbols and so on, so that's not an option because that is the reason why I want to copy paste it. Also, the object reference list is empty fyi.

Note 2: I'm new to Simio so I don't know if my reasoning is wrong, if so, please correct me.

Link to comment
Share on other sites

@ResultLand I understand. 

I am not sure about the level of success you will have with these suggestions, but they may be worth a try. Nevertheless, in the time that you vet these processes, it may be just as easy to re-create your entity in the new model. 

(1) You could try deleting the new model ModelEntity from the Navigation pane, then rename your entity of interest to ModelEntity.

(2) From your old model, save a version which just contains the entity of interest (delete all other objects in the Navigation pane), then load the file as a library in the new model after deleting the default ModelEntity from the new model. Finally, use the subclass feature to subclass your entity of interest and use newly created entity (from the subclass feature of your entity of interest) in the model. Subclassing the entity will allow you to manipulate the entity object definition, as you would expect. 

I hope this information helps. Thanks for using the forum.

Regards,

Alex

Link to comment
Share on other sites

15 hours ago, alexdmolnar said:

@ResultLand I understand. 

I am not sure about the level of success you will have with these suggestions, but they may be worth a try. Nevertheless, in the time that you vet these processes, it may be just as easy to re-create your entity in the new model. 

(1) You could try deleting the new model ModelEntity from the Navigation pane, then rename your entity of interest to ModelEntity.

(2) From your old model, save a version which just contains the entity of interest (delete all other objects in the Navigation pane), then load the file as a library in the new model after deleting the default ModelEntity from the new model. Finally, use the subclass feature to subclass your entity of interest and use newly created entity (from the subclass feature of your entity of interest) in the model. Subclassing the entity will allow you to manipulate the entity object definition, as you would expect. 

I hope this information helps. Thanks for using the forum.

Regards,

Alex

Hi Alex,

 

Option 1 doesn't work. Because the reference won't be correct.

Option 2 might do something, but at this point it is easier to recreate the Entity i suppose.

 

Thanks,

 

Jarek

Link to comment
Share on other sites

 Share

×
×
  • Create New...