question

David Chan avatar image
0 Likes"
David Chan asked Jason Lightfoot commented

Object.create() for user library object

Hi I am not sure if Object.create() can be used for object from the user library. Anyone can advise me? From the forum, it looks like createinstance or createcopy is still the approach.


David

FlexSim 24.0.1
create objectobject.create
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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Jason Lightfoot commented

As far as I'm aware Object.create() can only create objects that are present in the library folder of the main tree and does so by referencing their class name.

capture1.png

Apart from the node location, an object from a user library will likely just be a customized version of some default object and as such still belong to the same class.

So no, I don't think Object.create() can be used for user library objects.

It could however be used of objects that are part of custom modules that implement their own class.


capture1.png (3.3 KiB)
· 2
5 |100000

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

David Chan avatar image David Chan commented ·
@Felix Möhlmann Thanks

David

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ David Chan commented ·
Some information on copying objects here.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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