Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set the format of an exported file by C++?

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
235 Views, 2 Replies

How to set the format of an exported file by C++?

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);
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

You probably want to ask this question in the customization group. To most of us
here, that is just some random letters.

--
Dave Jacquemotte
Automation Designer
www.autoconcorp.com



"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);
>
>
>
>
Message 3 of 3
Anonymous
in reply to: Anonymous

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);
>
>
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report