Mr. Wilson Wang 0 Report post Posted February 13, 2016 Simple question. What type does it support? surface? line? When I tried to import iges file, I found it takes huge memory. How can I make it better? I did not do any transformation and I think the computer would crash. if(!In.exists()) echo("Invalid input file, file does not exist.") break() endif igesDeprecatedImport importer() importer.import(In.getFileName()) objectlist imported(importer.getLastImportedObjects()) surfacegroup ShipSurf() unsigned i(0) while(i<imported.getCount()-1) ShipSurf.addEntities([imported.at(i).castTo(FBSplineSurface)]) i+=1 endwhile Share this post Link to post Share on other sites
Karsten Wenzke 12 Report post Posted February 13, 2016 Hey Wilson, The iges import supports surfaces , curves and points.The surfaces are imported as NURBS surfaces. You are casting it to FBSPLINE surfaces.Try the following code: if(!In.exists()) echo("Invalid input file, file does not exist.") break() endif igesDeprecatedImport importer() importer.import(In.getFileName()) objectlist imported(importer.getLastImportedObjects()) surfacegroup ShipSurf() foreach(FSURFACE surf in imported) ShipSurf.add(surf) endfor Information about foreach can be found in the FDefineFeatureDlg documentation in CAESES or in the document in this post. Cheers, Karsten Share this post Link to post Share on other sites
Mr. Wilson Wang 0 Report post Posted February 14, 2016 Hi, Karsten It is working!! Thanks a lot. One more question: how can I export an imagesurfacegroup as Iges? Does foreach can take the job? Best wishes Hey Wilson, The iges import supports surfaces , curves and points.The surfaces are imported as NURBS surfaces. You are casting it to FBSPLINE surfaces.Try the following code: if(!In.exists()) echo("Invalid input file, file does not exist.") break() endif igesDeprecatedImport importer() importer.import(In.getFileName()) objectlist imported(importer.getLastImportedObjects()) surfacegroup ShipSurf() foreach(FSURFACE surf in imported) ShipSurf.add(surf) endfor Information about foreach can be found in the FDefineFeatureDlg documentation in CAESES or in the document in this post. Cheers, Karsten Share this post Link to post Share on other sites
Karsten Wenzke 12 Report post Posted February 15, 2016 Hey Wilson. For the iges export it depends a bit but this would export all surfaces which are in the list surfaces. igesExport exporter() imagesurface img() objectlist surfaces() surfaces.add(img) exporter.add(surfaces) string filepath(resolveenv("$PROJECTDIR")+"/export.iges") // iges file will be saved in the project directory. exporter.export(filepath)for an imagesurfacegoup: igesExport exporter() surfacegroup group() imageSurfaceGroup imggroup(group) exporter.add(imggroup) string filepath(resolveenv("$PROJECTDIR")+"/export.iges") exporter.export(filepath) I am pretty sure you can change the feature code to your needs. Cheers, Karsten Share this post Link to post Share on other sites
Mr. Wilson Wang 0 Report post Posted February 16, 2016 Thank you so much, Karsten. I've tried this code. But some problems occured and iges file equals to null. I've considered some that can be the problems as followed: 1. It shows warning "*** INFO IGES Import : entity type warning [detected type 406 is unsupported]" when I import the original IGES file. The iges file comes from Rhino. 2. The console also shows *** INFO IGES Export : processing [exporting 1 object(s)] when file is exported and the exporter.iges is null. However when I've tried to export the original surfacegroup as Iges, it shows *** INFO IGES Export : processing [exporting 3354 object(s)] and exported that successfully. 3. I've also tried to convert the imagesurfacegroup to another surfaceGroup and export it , unfortunately, the program crashed when exporting(or running). Best wishesHey Wilson. For the iges export it depends a bit but this would export all surfaces which are in the list surfaces. igesExport exporter() imagesurface img() objectlist surfaces() surfaces.add(img) exporter.add(surfaces) string filepath(resolveenv("$PROJECTDIR")+"/export.iges") // iges file will be saved in the project directory. exporter.export(filepath)for an imagesurfacegoup: igesExport exporter() surfacegroup group() imageSurfaceGroup imggroup(group) exporter.add(imggroup) string filepath(resolveenv("$PROJECTDIR")+"/export.iges") exporter.export(filepath) I am pretty sure you can change the feature code to your needs. Cheers, Karsten Share this post Link to post Share on other sites
Karsten Wenzke 12 Report post Posted February 16, 2016 Hey Wilson, 1. The IGESdeprecated does not support all types of iges types. It does not support trimmed surfaces at all.For the import use genericimport instead of igesimportdeprecated . 2. Okay .... Take a look at the attached feature definition. IgesExport.fdf igesExport exporter() imagesurfacegroup imggroup(group) // group is an argument of type surfacegroup exporter.add(imggroup.getSurfaceGroupFromImage()) // .getSurfaceGroupFromImage() is solving the export of only one object. string filepath(resolveenv("$PROJECTDIR")+"/export.iges") // iges file will be saved in the project directory. exporter.export(filepath) 3. The crash shouldn't happen. Have you done that in a feature definition or in the object editor? I've attached the reviewed loops tutorial which will be in the upcoming release which is using the other igesimport. Cheers, Karsten03_Loops.pdf Share this post Link to post Share on other sites