Simcenter Prescan Building Prescan experiment using data model API

2023-08-31T07:43:27.000-0400
Prescan Teamcenter Share Simcenter Prescan Marketing

Summary

This article discusses steps to build the experiment from scratch using DMAPI from Matlab without using Prescan GUI


Details

Steps 1: Using Matlab and DMAPI function we would start building the experiment. Start with creating new script with the below command

%Create Prescan experiment 
experiment = prescan.api.experiment.createExperiment();
%Give the experiment a name
pbFile = 'CreateExpFromMatlab.pb';
%Save the experiment data model file
experiment.saveToFile(pbFile);

Step 2: Add actors and sensor as required 

%Add an actor to the experiment
myRivianR1T1 = experiment.createObject(experiment.objectTypes.Rivian_R1T_1);
Attach a camera to the actors
myRivianR1TCam = prescan.api.camera.createCameraSensor(myRivianR1T);


%This command is just to retrieve the camera attached to the RivianR1T
camsensorRivianR1T = prescan.api.camera.getAttachedCameraSensors(myRivianR1T);

%This command is just to retrieve the cameras used in the experiment
camsensorExp = prescan.api.camera.getCameraSensors(experiment);

%Save the experiment datamodel
experiment.saveToFile(pbFile);
%Run the experiment
prescan.api.simulink.run(experiment,'StopTime','10');
 

KB Article ID# KB000121931_EN_US

Contents

SummaryDetails

Associated Components

Documentation Installer License Software