Model Simplification Import Examples
- Last UpdatedFeb 25, 2025
- 1 minute read
-
Simple - just do it
import 'Aveva.ModelSimplification'
using namespace 'Aveva.ModelSimplification'
!simplifierObj= object MODELSIMPLIFIEROBJ()
!simplifierObj.setInputFilePath(|InputCADFilePath|)
!simplifierObj.setSimplificationLevel(1)
!simplifierObj.setCadFormat(|STEP|)
!simplifierObj.setImportModelAs(|SUBE|)
!simplifierObj.simplifyandimport()
-
Querying several of the default parameters
import 'Aveva.ModelSimplification'
using namespace 'Aveva.ModelSimplification'
!simplifierObj= object MODELSIMPLIFIEROBJ()
Q var !simplifierObj.getOutputFolderPath()
Q var !simplifierObj.getSimplifcationLevel()
-
Batch process using do loop
define function !!ModelSimplifcationBatchProcess()
!inputCadFiles = ARRAY()
!inputCadFiles.append(|InputCADFilePath|)
!inputCadFiles.append(|InputCADFilePath|)
!inputCadFiles.append(|InputCADFilePath|)
!inputCadFiles.append(|InputCADFilePath|)
using namespace 'Aveva.ModelSimplification'
!simplifierObj= object MODELSIMPLIFIEROBJ()
!simplifierObj.setSimplificationLevel(1)
!simplifierObj.setCadFormat(|STEP|)
!simplifierObj.setImportModelAs(|SUBE|)
do !cadFile from 1 to !inputCadFiles.size()
!simplifierObj.setInputFilePath(!inputCadFiles[!cadFile])
!isSuccess = !simplifierObj.simplifyandimport()
if(!isSuccess) then
$p Simplification ran successfully.
else
$p Simplification ran into an error
endif
enddo
Endfunction
-
TTY batch mode
import 'Aveva.ModelSimplification'
using namespace 'Aveva.ModelSimplification'
!simplifierObj= object MODELSIMPLIFIEROBJ()
!simplifierObj.setInputFilePath(|InputCADFilePath|)
!simplifierObj.setSimplificationLevel(1)
!simplifierObj.setCadFormat(|STEP|)
!simplifierObj.setImportModelAs(|SUBE|)
!simplifierObj.simplifyandimport(1)
-
Import simplified (.fbm) file
For import of simplified (.fbm) file using E3D Command window or in TTY mode, an IMPORT OPTION specifying Simplification Engine Path need to set.
Example:
IMPORT OPTION |AVEVA_SIMPLIFICATION_INSTALLATION| |<Simplification_ Engine_Path>|
Default location of installation of Simplification Engine is: C:\Program Files\AVEVA\ModelSimplification.2.1.0\Engine
After this IMPORT OPTION is set, PML callable Model Simplification object can be used for importing the simplified (.fbm) file or we could use the raw native IMP Command to do the import of simplified (.fbm) file.
IMP FBM “<Simplified_fbm_file_path>” LOG BRIEF “<Log_file_path>” BUCKETSIZE 100
Note:
In the Appware and in E3D Command window you need an import command (to load the dll containing their PMLNetControls)import 'Aveva.ModelSimplification'
This is usually done once only, probably in application start-up macro. You can have it in your form, but you will then need to handle the error which will occur if the import is executed more than once:
import 'Aveva.ModelSimplification'
handle (1000.0)
-- Aveva.ModelSimplification dll already loaded
enhandle