.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Document CloseAndDi scard In 2013
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
The Doc.CloseAndDiscard() method on documents returns message of ' not a member of 'Autodesk.AutoCAD.ApplicationServices.Document'.
How do we close a dwg file in AutoCAD 2013?
Thanks
Solved! Go to Solution.
Re: Document CloseAndDi scard In 2013
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: Document CloseAndDi scard In 2013
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Works great, thanks.
Re: Document CloseAndDi scard In 2013
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
more clearly, it's DocumentExtension.CloseAndDiscard(doc)
just in case anyone would expect it to be an extension method, like i did
Re: Document CloseAndDi scard In 2013
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
It is a extension method
public static void CloseAndDiscard(this Document doc)
{
CloseInternal(doc, true, null);
}
Re: Document CloseAndDi scard In 2013
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I checked it and you're right, but I am using VB.net. And there it isn't an extension method.
Taken from MSDN:
Notice that the extension method definition is marked with the extension attribute <Extension()>. Marking the module in which the method is defined is optional, but each extension method must be marked. System.Runtime.CompilerServices must be imported in order to access the extension attribute.
Extension methods can be declared only within modules.
Re: Document CloseAndDi scard In 2013
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
With C# you import the namespace and VB you import the module, but it still is a extension method.
Re: Document CloseAndDi scard In 2013
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I am importing
Imports Autodesk.AutoCAD.ApplicationServices.DocumentExtension
which is a class. I couldn't find the module I am supposed to import in VB. Do you know where I can find it?
Re: Document CloseAndDi scard In 2013
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: Document CloseAndDi scard In 2013
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I know that, Alexander. I was asking about the module for VB.






