Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

STL export Sync/async Jlink

Pro/Bjarne

New member
Hi
Hope somebody can help me. I'm trying to export a part to stl through a syncronious jlink app. I'm able do this if I specify the name of the coordinate system from the Model Tree.


The problem is that the user might delete the coordinate system from the Model Tree, in which case the export fails.


Trying to solve this, I found that with a async jlink app, I'm able to do an export where I specify "" (blank) for the coordinate system name and proe seems to use the "Default" which is actually what I want. However, if I do the same with a sync app it gives a "ToolKitNotFound" exception when the export() method is called.


Is there some way to get the async behaivor in a sync app? I have tried with "", "default", "Default", null. It only works if I give the name of a coordinate system from the model Tree


Thanks,
Bjarne



some code:


//extract coordinate system name
ModelItems c_systems;
String Csys = null;
c_systems = model.ListItems(ModelItemType.ITEM_COORD_SYS);
int size = c_systems.getarraysize();
for (int i = 0; i < size ; i++)
{
Csys = c_systems.get(i).GetName();
break;
}


//create export instructions using default coordinate system:
//STLBinaryExportInstructions stlInstruction = pfcModel.STLBinaryExportInstructions_Create(""); //works in async
STLBinaryExportInstructions stlInstruction = pfcModel.STLBinaryExportInstructions_Create(Csys); //works in sync if coordinate system exist


stlInstruction.SetQuality(10);
model.Export("tmp.stl", stlInstruction);
 

Sponsor

Articles From 3DCAD World

Back
Top