.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Document Object by a drawing file name

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
NKCAUTOCAD01
659 Views, 3 Replies

Document Object by a drawing file name

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.
3 REPLIES 3
Message 2 of 4
Hallex
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
Message 3 of 4
NKCAUTOCAD01
in reply to: NKCAUTOCAD01

Dear Mr. Hallex
Thank you for immediate advice.

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

Message 4 of 4
Hallex
in reply to: NKCAUTOCAD01

You're welcome, M.Tsukamoto

Keep coding,

Cheers Smiley Happy

 

_____________________________________
C6309D9E0751D165D0934D0621DFF27919

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost