.NET
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
*Tim Riley
DocumentMa nager.MdiA ctiveDocum ent
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
251 Views, 2 Replies
08-18-2005 10:27 AM
Can someone explain something to me?
I am trying to get the active document in AutoCAD using C#. To do this I am
using:
Document doc =
Autodesk.AutoCAD.ApplicationServices.DocumentManag er.MdiActiveDocument;
To me this seems as if it should work as I am declaring the variable doc as
a Document and assigning it as the active document in AutoCAD. However when
I try to compile my code I get an error stating.
c:\Documents and Settings\TJRiley\My Documents\SharpDevelop
Projects\KSSetup\MainForm.cs(239,30): error CS0120: An object reference is
required for the nonstatic field, method, or property
'Autodesk.AutoCAD.ApplicationServices.DocumentMana ger.MdiActiveDocument'
Can someone please explain to me what this error message means?
Thanks,
Tim
I am trying to get the active document in AutoCAD using C#. To do this I am
using:
Document doc =
Autodesk.AutoCAD.ApplicationServices.DocumentManag
To me this seems as if it should work as I am declaring the variable doc as
a Document and assigning it as the active document in AutoCAD. However when
I try to compile my code I get an error stating.
c:\Documents and Settings\TJRiley\My Documents\SharpDevelop
Projects\KSSetup\MainForm.cs(239,30): error CS0120: An object reference is
required for the nonstatic field, method, or property
'Autodesk.AutoCAD.ApplicationServices.DocumentMana
Can someone please explain to me what this error message means?
Thanks,
Tim
Re: DocumentMa nager.MdiA ctiveDocum ent
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-18-2005 10:39 AM in reply to:
*Tim Riley
Tim,
Hi, I think you need to get the document manager from the Application object, like this:
[code]
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.D ocumentManager.MdiActiveDocument
[/code]
Good Luck,
Clif
Hi, I think you need to get the document manager from the Application object, like this:
[code]
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.D
[/code]
Good Luck,
Clif
*Tim Riley
Re: DocumentMa nager.MdiA ctiveDocum ent
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-18-2005 11:00 AM in reply to:
*Tim Riley
Doh...I can't believe I missed that.
Thank you very much.
Tim Riley
wrote in message news:4932513@discussion.autodesk.com...
Tim,
Hi, I think you need to get the document manager from the Application
object, like this:
[code]
Document doc =
Autodesk.AutoCAD.ApplicationServices.Application.D ocumentManager.MdiActiveDocument
[/code]
Good Luck,
Clif
Thank you very much.
Tim Riley
Tim,
Hi, I think you need to get the document manager from the Application
object, like this:
[code]
Document doc =
Autodesk.AutoCAD.ApplicationServices.Application.D
[/code]
Good Luck,
Clif
