.NET

.NET

Reply
Valued Contributor
ViktorCAD
Posts: 60
Registered: ‎06-18-2009
Message 1 of 4 (426 Views)

How to get user preferences (options) without COM api?

426 Views, 3 Replies
06-21-2010 04:51 PM

Anyone know if it is possible to get to profile preferences without COM api? So that I can read settings like what version to save the file as...

 

I noticed that preferences are only exposed in COM api, and I'd hate to bring COM api in just for this little thing, not that there's anything wrong with COM api, i just don't want to deal with another reference.

Thanks,

Viktor.

Valued Mentor
caddzone
Posts: 305
Registered: ‎01-26-2005
Message 2 of 4 (422 Views)

Re: How to get user preferences (options) without COM api?

06-21-2010 05:44 PM in reply to: ViktorCAD

You can use COM objects without having to import the COM references,

but it's a bit more involved in C# (In VB, it works the same way it did in

VBA, declaring COM objects as 'Object' and using late binding).

 

In C# late binding requires calls to InvokeMember() on the object returned

by calling GetType() on a COM object.

 

There should be some examples here, and searching on 'InvokeMember'

should turn them up.

 



AcadXTabs for AutoCAD
Supporting AutoCAD 2000-2011


Valued Contributor
ViktorCAD
Posts: 60
Registered: ‎06-18-2009
Message 3 of 4 (420 Views)

Re: How to get user preferences (options) without COM api?

06-21-2010 05:47 PM in reply to: ViktorCAD

Thanks Tony, trying to do that now. I know in some cases with AutoCad if you don't reference the library you won't get the same results, as I found out some things like zoomextents don't work well with late binding, or maybe it was just me.

Valued Mentor
caddzone
Posts: 305
Registered: ‎01-26-2005
Message 4 of 4 (418 Views)

Re: How to get user preferences (options) without COM api?

06-21-2010 05:54 PM in reply to: ViktorCAD

I very much doubt that late binding would have different results than

early binding, unless there is some discrepancy in the arguments passed,

whcih are not type-checked by the compiler as they are with early binding.



AcadXTabs for AutoCAD
Supporting AutoCAD 2000-2011


Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.