Here is a snippet of code that I use, and it creates 2000 version dxf files
by default. I have seen this format before, but never tested it "FLAT
PATTERN DXF?AcadVersion=R13".
CComPtr
newactivedoc;
Result = m_pApplication->get_ActiveDocument(&newactivedoc);
CComQIPtr partdoc(newactivedoc);;
if(!partdoc)
return false;
CComPtr compdef;
Result = partdoc->get_ComponentDefinition(&compdef);
CComQIPtr sheetmetalcompdef(compdef);
if(!sheetmetalcompdef)
return false;
Result = sheetmetalcompdef->Unfold();
if(FAILED(Result))
return false;
CComPtr dataio;
sheetmetalcompdef->get_DataIO(&dataio);
CComBSTR format = "FLAT PATTERN DXF";
CComBSTR nfilename = flname;
dataio->WriteDataToFile(format, nfilename);
"tassardge" wrote in message
news:E980BA3E7E42BC588F11002AEC2CE05F@in.WebX.maYIadrTaRb...
> An error occured, When I export the flatpattern of sheetmetal part to a
dxf
> file by C++. I think it might be caused by the wrong file format. But in
> Basic the format is correct. So How can I set the format of the exported
> file in C++?(the following is wrong code)
>
> // the format of the file.
> #define DXF_FILE "FLAT PATTERN DXF?AcadVersion=2000"
>
> CComBSTR format(DXF_FILE);
> CComBSTR name("test.dxf");
>
> CComPtr pDataIO;
> HRESULT hr=pDataIO->WriteDataToFile(format,name);
>
>
>
>