Hey guys,
i've been experimenting with the file saving/exporting options, but i've got no clue how i can access the options hidden in the DXF export options dialog.
I found this in the api, but it doesn't seem to be available: https://community.coreldraw.com/sdk/api/draw/20/c/dxfexport
It also seems there's a way to create an ExportFilter of sorts that should be able to set the required version, but i can't figure that part out.
Can someone help me with this?
Thanks in advance!
Maybe you will find what you need here...
I think the trick will be to add a reference to the appropriate .flt library. It would be found on the next kind of path: "...\Corel_Installation_Folder\Filters64(or Filters for 32bit)\IEDXF.flt".
You should browse to that folder (in EDE: Tools -> References... -> Browse... and go to the above suggested path. You will select 'All Files' from 'Files of type:'...
After that the declaration Dim FilterObject As DXFExport will have a meaning and you can choose the filter properties/methods just selecting the options in a With - End With sequence like in the next picture:
Hmm thanks. Altho i'm not quite sure how to reference .flt files. Neither Visual Studio (trying to export files using C#), nor the VBA Macro IDE seems to be able to create a reference to those .flt files and a fitting .dll is sadly not available. :S
Sorry...
I did not observe you were asking for referencing a C# project.
I explained how can such a file must be referenced in VBA for a .GMS macro...
It looks to not be possible referencing of something else then dll, tlb, olb, ocx, exe...
No need to appologize. :D Thanks for taking the time to help me out!
If i was able to create a macro, which i could then somehow call from my c# addon, that would lead me to the same result. But as i mentioned, i wasn't able to reference the .flt files in the vba macro ide either.
This should be simple...
I did that before writing my first answer... On X8 64bit. What Corel version do you use? Now I checked it on X6 too. The attached picture has been done by me on my Corel installation...
I repeat the steps (more detailed) for referencing a .flt file:
1. Press Alt + F11 in order to reach Corel IDE. Now working (only) in IDE...
2. Open a window of a GMS file. GlobalMacros, for instance. A GMS file must receive the reference in discussion... The reference must be add to an existing .GMS file.
3. Press Tools -> References... -> Browse... and go to '...\CorelInstallationPath\Filters64".
4. Change 'Files of type:' from default '(*.olb, *.tlb, *.dll)' to 'All Files (*.*)', pressing the small arrow from the right side and select the last option.
5. Look for 'IEDXF.flt' file, select it and press 'Open'.
6. Press Ok button in the browse window.
Now you referenced IEDXF.flt to the necessary .GMS file... Only now the declaration 'Dim FilterObject As DXFExport' means something for Corel VBA and does not return an error any more...
Is that clear enough?
If not, do not hesitate to tell me what you done and what does not work as expected...
As for C# project use I would add the .flt file as 'existing item' to the project and after that I would try to somehow explicitly use it for filter declaration...
Thanks FaneDuru.
I'm using 2019 64bit, sadly my 2018 version has some trouble installing addons (i suspect it's cause it's a 32 bit version that i'm running on a 64bit system), however i also should have a X7 Version that i could install and try it with.
Anyway, i repeated all steps as you instructed but i'm still getting the error that the file can't be referenced when trying to add it.
Sorry for the language... should've installed it in english. ^^
It looks they 'improved' it...
X8 allows referencing of this file type as I explained. X6 does the referencing operation in the same way. Just tested. The reference name shows 'FilterDXFLib'...
No problem with your German interface. Some time before I learned a little German...
And anyhow, English is not my native language, too.
In this case I do not imagine how you can solve the problem. I do not have 2019 installed to try something by myself. Please check if your installation does not also have .dll or some other compatible file (.olb, tlb). Maybe they did that since 2019 version does not allow such a type referencing. In the link I firstly suggest they were speaking about .dll. I did that 'trick' because I did not have such an option, not .dll existing in that location. I would suggest you to try finding all files (in Corel Installation Folder) named IEDXF. Maybe you are lucky and find a .dll able to be referenced in C#, too.
Hmm, i think we got it wrong... i experimented a bit and it seems that using ExportFilter applies to all available kinds. Using this actually exported my file with the right version:
Public Sub Export()Dim filterObject As ExportFilterSet filterObject = ActiveDocument.ExportEx("testr11.dxf", cdrDXF)With filterObject.Version = 6.FinishEnd WithEnd SubNow i just need to figure out how to call that macro from a C# addon, or even better, somehow do that in C# itself. xD
Sadly there's no way to access the Version property in C#. (Or at least i didn't find one)
I am afraid it is not possible to obtain the export (CAD) Version without having the right reference to that filter...
For instance, I can see the specific export Dialog (in VBA after correct referencing), I can change/set the Export Version (manually or programmaticaly) and than collect it in Immediate window...
After editing:
I was wrong...
I tested your code (in VBA) and even if the global filter looks to not having any Version property (just writing a dot in With - End With iteration), putting .ShowDialog, it shows the DXF export options and for Version 6 it is AutoCAD R9...