Pointers in module SDK

Pointers in module SDK

Viviane_B
Not applicable
114 Views
5 Replies
Message 1 of 6

Pointers in module SDK

Viviane_B
Not applicable

[ FlexSim 23.0.8 ]

Hello.

I am working with module SDK and I am referecing some objects using pointers. However when I open a saved model, the pointers are all reset. I would like to know if there is a way to not lose the reference of pointers when opening a model.

Thanks.

0 Likes
115 Views
5 Replies
Replies (5)
Message 2 of 6

Matthew_Gillespie
Autodesk
Autodesk
@Viviane_B Where are the pointers and what are they pointing at?


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 6

Viviane_B
Not applicable

I am sorry for the lack for a more detailed explanation. The pointers are declared in the module classes, cpp files, and they are referencing the model objects. The objects are created in the model, stored in a treenode and then referenced (using objectAs).

0 Likes
Message 4 of 6

joerg_vogel_HsH
Mentor
Mentor
@Viviane_B, please read about pointers as a reference to hardware memory addresses. As long as a model is not compiled and a pointer is assigned to an address they should be empty by default. A method can establish a kind of coupling between an hardware address and a model tree node, but therefore this method must be executed right from the opening of a model. You might want to insert a construct that fulfill this kind of coupling by an event like on open a model. I believe it won’t be possible to establish exactly the same computer memory address to a reloaded model on modern PCs nowadays. This was a common practice, when computers were built with an capacity of some few kilobytes and it’s System didn’t swap assembled machine code to different physical resources.
0 Likes
Message 5 of 6

Matthew_Gillespie
Autodesk
Autodesk
Can you post an example of what you're doing? This still isn't enough information to understand what is going on.


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 6 of 6

Jeanette_Fullmer
Community Manager
Community Manager

Hi @viviane-b,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question.

0 Likes