« Back

ADD_INTERREF to model

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
ADD_INTERREF to model
add_interref
Answer
05/11/18 12:35
Dear Team,

I have a first model called Map, where the class Arm has 2 interref attributes called (1) Device and (2) Capabilities. The user should be able to model an object of class Arm in the Map Model and choose the instance of the arm, which is modelled in the Laboratory Model, through the Device attribute. The instance of the robots in the Labotory Model contains an interref attribute also called Capabilities, which points to various other models where the capabilities are modelled.

Now, my idea is that, when the user selects the instance of the arm (i.e. Arm1) from the Device attribute in the Map model, automatically the attribute Capabilitites (of the map model) should show the same references to the capabilities as shown in the Capabilities attribute of the Laboratory model for the reffered arm object.
I now used GET_INTERREF to get all the referenced model from the Arm of the Laboratory model (this works fine) but I am having troubles in adding them into the interref attribute of the Arm in the Map Model. If I understand right, ADD_INTERREF only works for  getting references to instances and not for references to models. I could not figure out how to solve this. 

Thanks in advance for your help
Regards
Valentina

RE: ADD_INTERREF to model
Answer
17/11/18 16:35 as a reply to Valentina Tessa.
!!!UPDATE!!!

Hi all,

I menaged to reference a object as well as a model - both work now. However, I realized that the problem is the fact that the model I want to reference to is not visible when I click on the "+" button to add a reference. Thus, it also does not work when I try to add the reference with ADD_INTERREF instead of doing it manually. Why are only some models shown when I try to add an interref and not all the ones I have in my project?

Thanks a lot again in advance!

Regards
Valentina

RE: ADD_INTERREF to model
modeltype interref objref facets
Answer
10/12/18 11:18 as a reply to Valentina Tessa.
Dear Valentina,

If you have defined a object or model reference only for one model type, then only the models of the specified model type will be shown. Thus, you need to define a reference for each model type.

Example: Only for model type “Practice”:
1OBJREF
2  mt:"Practice"
3  c:"B"
4  max:100

Example: For model type “Practice” and “Sample”:
1OBJREF
2  mt:"Practice"
3  c:"B"
4  max:100
5OBJREF
6  mt:"Sample"
7  c:"A"
8  max:100