DB Snippets

From Developer Documents
Revision as of 08:00, 16 September 2011 by Hannu Niemisto (talk | contribs) (Created page with "== Finding all models in the project == <code> Session session = Simantics.getSession(); Layer0 L0 = Layer0.getInstance(session); SimulationResource SIMU = SimulationResource.ge...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Finding all models in the project

Session session = Simantics.getSession(); Layer0 L0 = Layer0.getInstance(session); SimulationResource SIMU = SimulationResource.getInstance(session); Resource project = Simantics.getProject(); Collection<Resource> models = session.syncRequest(

   new ObjectsWithType(project, L0.ConsistsOf, SIMU.Model)

);