Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Who can help me im trying to export a STEP filewith weblink in wf 3.0. But when i use this function it's given me an error like [object type].
function ExportSTP(model){
try
{
var exportflag = new pfcCreate ("pfcGeometryFlags").Create();
var modelexport = new pfcCreate("pfcAssemblyConfiguration").EXPORT_ASM_SINGLE_FILE;
exportflag.AsSolids = true;
var STPexport = new pfcCreate("pfcSTEP3DExportInstructions").Create(modelexport, exportflag);
var naam = model + ".stp";
CurModel.Export(naam, STPexport);
}
catch(err){
alert("Kan tekening niet Exporteren naar STP reden: " +err );
}
}
> Who can help me im trying to export a STEP file with weblink in wf 3.0.
> But when i use this function it's given me an error like [object type].
>
> var naam = model + ".stp";
> CurModel.Export(naam, STPexport);
I think one or both of the above lines are going to give you problems.
The first of the two should probably look like this:
var naam = model.FullName + ".stp";
The second should perhaps look like this?:
model.Export(naam, STPexport);
I don't see where you have defined CurModel.
Marc
--
Marc Mettes
-
Visit My CAD/PDM AutomationBlog
Or, Subscribe to My CAD/PDM Automation Blog by Email
I see. I've added theglobalconnection. and changed the model to just a loaded part. But it still gives me an error.
function ExportSTP(){
try
{
var mGlob = pfcCreate("MpfcCOMGlobal");
var oSession = mGlob.GetProESession();
var CurModel = oSession.CurrentModel;
var exportflag = new pfcCreate ("pfcGeometryFlags").Create();
var modelexport = new pfcCreate("pfcAssemblyConfiguration").EXPORT_ASM_SINGLE_FILE;
exportflag.AsSolids = true;
exportflag.AsQuilts = true;
var STPexport = new pfcCreate("pfcSTEP3DExportInstructions").Create(modelexport, exportflag);
CurModel.Export("test.stp", STPexport);
}catch(err){
alert("Kan tekening niet Exporteren naar STP reden: " +err );
}
}
Was Your problem solved in the meantime?