question

Gui Vaccaro avatar image
0 Likes"
Gui Vaccaro asked Arun Kr answered

How to identify a 3D object from a user library?

Hello,

How can one find an object under model().subnodes which was instantiated from a user library? For instance, let's say one created a "MyQueue" derived from the Queue object and added it to a user library. How can they now separate the instances of "MyQueue" from other queues using flexScript?

The only property that seems to be available is "windowtitle".

Thank you.

FlexSim 25.0.0
flexscriptuserlibrary
5 |100000

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

1 Answer

Arun Kr avatar image
0 Likes"
Arun Kr answered

You can compare the windowtitle and class name to identify the object is an instance of userlibrary or not.

Object MyQueueRef = Model.find("MyQueue");

string ClassName_MyQueue = classobject(MyQueueRef).name;
string WindowTitleMyQueue = Model.find("MyQueue").find(">windowtitle").value;
if(ClassName_MyQueue == WindowTitleMyQueue)
{
print("This Object is not a user library instance);
else
{
print("This Object is a user library instance");
}
5 |100000

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