.NET

Reply
Valued Contributor
NKCAUTOCAD01
Posts: 85
Registered: ‎08-31-2011
Message 1 of 4 (173 Views)
Accepted Solution

Document Object by a drawing file name

173 Views, 3 Replies
11-27-2012 09:29 PM

In AutoCAD.NET API, please tell me.

From DocumentManager, I want to acquire Document Object by a drawing file name. 

Please tell me the method.

I would like it in VB.NET if possible.
Thanking you in advance.
*Expert Elite*
Hallex
Posts: 1,553
Registered: ‎10-08-2008
Message 2 of 4 (165 Views)

Re: Document Object by a drawing file name

11-28-2012 01:57 AM in reply to: NKCAUTOCAD01

Think you need all documents what is already opened

then you can try this code

 

       <CommandMethod("tfl")> _
        Public Sub testDrawings()

            Dim dm As DocumentCollection = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager
            Dim doc As Document = dm.GetDocument(HostApplicationServices.WorkingDatabase)
            Dim ed As Editor = doc.Editor
            ed.WriteMessage(vbLf + "Current Document: {0}", doc.Name)

            Dim ienum As IEnumerator = dm.GetEnumerator
            While ienum.MoveNext
                Dim idoc As Document = DirectCast(ienum.Current, Document)
                ed.WriteMessage(vbLf + " Document item in collection: {0}", idoc.Name)
            End While

        End Sub

 

 

 

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Valued Contributor
NKCAUTOCAD01
Posts: 85
Registered: ‎08-31-2011
Message 3 of 4 (146 Views)

Re: Document Object by a drawing file name

11-28-2012 04:43 PM in reply to: NKCAUTOCAD01

Dear Mr. Hallex
Thank you for immediate advice.

It was saved very much.Yours sincerely,
NKCAUTOCAD01 (M.Tsukamoto).

*Expert Elite*
Hallex
Posts: 1,553
Registered: ‎10-08-2008
Message 4 of 4 (139 Views)

Re: Document Object by a drawing file name

11-28-2012 09:23 PM in reply to: NKCAUTOCAD01

You're welcome, M.Tsukamoto

Keep coding,

Cheers :smileyhappy:

 

_____________________________________
C6309D9E0751D165D0934D0621DFF27919

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community