Acad export schemes - how to access via script

Hi there,

This issue has been raised by me in the past, as long ago as V4… Doesn’t look like there is an easy way to access AutoCAD (dxf,dwg) export settings/schemes in a script… I thought by now that the schemes might be stored in the general .xml settings file, but I don’t see anything there. Previously, they weren’t even exposed in a visible registry key, there was a hack to get at them via the registry that Dale posted once, but it’s not an easy one.

I didn’t see anything either in RhinoCommon that looked promising, maybe I missed something…

For me at least it would be useful to see what schemes the user has stored so as to be able to set one on export; far better would be to be able to create a scheme in the script or be able to set the export parameters without having to create a scheme first.

Has any progress been made on this or is it still in the V4 and earlier stage…?

Thanks, --Mitch

Does -_AcadSchemes do anything for you?

Hey Lowell,

Well, almost… it lacks a “list” option where I can see all the schemes that are already there; I don’t want to be trying to overwrite something that is already there, but if it is there I do need to verify that it has the correct options set.

The command won’t let me create a new scheme with a name that exists, and you can only edit the current scheme. So I would have to first try to make the scheme name I want current and see if that fails (don’t know how to detect that), then create a new one with the right settings; or, if the scheme does exist, I would have to try to check/edit it, which is nearly impossible…

So, no, it doesn’t help me much, unfortunately - unless I’m completely missing some option.

Edit:
Oh, I guess I could make it import a preset .ini - which I suppose I could write out with the script - but that is always a pain with file save permissions, and I still don’t know about overwriting an existing scheme…

–Mitch

OK. That’s all there is.
I guess moving it from registry to the xml file would be the only hope of something in a tractable time range.
I’ll see what the chances of that are.

OK, thanks Lowell. As -AcadSchemes (dash version) doesn’t do anything in V5 Windows or Mac, this is moot as I will have a lot of V5 “clients” on both platforms to work with for awhile yet… Unfortunately, the Mac side (V5 or WIP) doesn’t seem to allow a scheme import either @dan . So I’m basically back to square one here anyway…

Cheers, --Mitch

Yep, that one’s been on our radar for awhile. Thanks. Good to check.

Hi,
@dan, I am asking myself if there is a way to get the existing export-schemes via RhinoCommon?

Thanks,
T.

I don’t think there is, but I might be mistaken. @stevebaer might want to correct me on this.

Perhaps a better question to aid my understanding is: what are you trying to do?

We won’t have ways to access the existing schemes from RhinoCommon, but we are actively working on ways to defines all of the options for saving to different file formats (including DWG/DXF) from RhinoCommon in Rhino 8. You will be able to create an options class for DWG writing in RhinoCommon, set a few custom properties and then save with these options.

@stevebaer nice to hear. :slight_smile:
@dan I am working on an interface for exporting items a bit more convenient for our needs.
Therefore it would be quite comfortable to have a dropdown with all the schemes. If I’d be able to access it via RhinoCommon I would always have an up to date list.

But I guess soon it will be possible?

Hi @stevebaer,
I just studied the documentation and it’s super thrilling.
As I have seen so far here:
https://developer.rhino3d.com/api/rhinocommon/rhino.fileio.filedwgwriteoptions
this looks like what I have been looking for. Also the same for the step-export.

Am I right that the Rhino.FileIO.FiledwgWriteOptions also apply to dxf-exports.
I would set the options and then when exporting the doc I would just use “.dxf” as a file-format.

Thanks,
T.

Yes, I believe that is correct.