PDA

View Full Version : AutoCAD dotnet object model? + C# Plotting



schrodingerscat
2008-12-18, 04:11 AM
Firstly, I was wondering if there is an AutoCAD object model similar to the "Autodesk Revit 2009 API object model"

Writing in C# I have to know each type of variable/object/etc before I define it. If I've never seen a list I can only go by other people's examples, if what I want to do nobody else has done/shared then I probably won't be able to do.

If that made no sense here is an example:
PlotSettingsValidator psv = PlotSettingsValidator.Current;

this is not a "standard" type. Without a list of these and no definition of what it does, how can I use it properly?

Is there a list like this?

Also, I'm looking for a way to plot to a PS file. I can't find anything on the net and all the plotting examples that I've thought of modifying firstly assume that the page setup is correct (which it may not be), and don't mention anything about plot style tables (which is a major part of what I'm trying to do).

Any ideas?

dmarcotte4
2008-12-18, 07:29 PM
Have you looked at the help files that comes with the ObjectARX SDK?

schrodingerscat
2008-12-19, 01:33 AM
I had, but I've just looked further. I had been looking through the ObjectARX Reference which didn't seem too helpful, but now I've noticed the AuotCAD Managed Class Reference and it's exactly what I needed.

Still need to find a quick and simple guide to c# plotting.

sinc
2008-12-19, 01:33 PM
What are you using to write your code? Intellisense should also be indicating types. It can even be more useful than the docs at times, since it gives you the actual type you need in C#.

The ObjectARX docs can also be helpful, but they are written for C++ developers. Most of the things in the ObjectARX library have a managed wrapper around them, and will also be found in the managed docs. But some things don't have a managed wrapper. However, you can still call the ObjectARX code from C# if you need to. So it can still be helpful looking through the ObjectARX docs from time to time, just to see what's there.

schrodingerscat
2009-01-04, 09:46 PM
(after 2 weeks annual leave) I'm writing in SharpDevelop. I'm not having too many problems after using the ObjectARX guide but I'm still having issues with plotting via C#.

Ed Jobe
2009-01-05, 05:00 PM
(after 2 weeks annual leave) I'm writing in SharpDevelop. I'm not having too many problems after using the ObjectARX guide but I'm still having issues with plotting via C#.
If you specifically state what your problem is, someone may be able to help you.

schrodingerscat
2009-01-05, 10:48 PM
If you specifically state what your problem is, someone may be able to help you.

If I knew what the problem is I could tell you, but I've been using a modified version of the "basic autocad plot" code off through the interface and it wasn't working. I kept stripping back my changes trying to find where the problem is and even though I'm at the point where MY CODE IS EXACTLY THE SAME WORD FOR WORD, SYNTAX FOR SYNTAX as the website, I'm still receiving an "eInvalidInput" error on a line of it.

I've posted on the website with specifics so hopefully I'll be able to get it sorted. At the moment my program is at about 90% completion, just can't get it to plot to PDF.

Ed Jobe
2009-01-06, 04:23 PM
If I knew what the problem is I could tell you,
You just did, at least partially. Don't confuse "the problem" with "the cause of the problem". Pretend we're dumb, because at this point we are until we get sufficient information to build a picture of what you are going through. You need to describe the "problem" as best as you can, i.e. what symptoms you are seeing, what you expect to see happen, error messages, etc. Post your code as well and describe any troubleshooting efforts you have already done.

schrodingerscat
2009-01-06, 09:52 PM
I've posted my findings in the "Even possible" thread I started. Didn't really think it through starting 3 threads that all ended up leading to the same place ey? Didn't realise that would happen.