Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Obtaining a list of opened drawings

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
219 Views, 7 Replies

Obtaining a list of opened drawings

Hi,

Could someone remind me on how to make a list of the drawings wich are
opened in an AutoCAD session.

M
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

Marcel,

you can use this function or modify it to suite your needs:


;;f:list_open_dwgs: lists all open drawings - returns a cons list with readonly status as 1 else 0 if tag is true

(vl-load-com)

(defun f:list_open_dwgs (tag / doc dwg lst)
(vlax-for doc (vla-get-documents (vlax-get-acad-object))
(setq dwg (strcase (vla-get-FullName doc)))
(if tag
(setq lst (append lst (list (cons dwg (if (= (vla-get-ReadOnly doc) :vlax-True) 1 0)))))
(setq lst (append lst (list dwg)))
);if
)
lst)

Peter
Message 3 of 8
Anonymous
in reply to: Anonymous

maybe like:

;;Usage (setq docslist(DBGetDocsList))
(defun DBGetDocsList (/ docs inc docslist)
(setq docs (vla-get-Documents (vlax-get-object "AutoCad.Application"))
inc 0
docslist (list)
)
(repeat (vla-get-count docs)
(setq docslist (append docslist (list (vla-item docs inc)))
inc (+ inc 1)
)
)
docslist
)


--
Dann M Brower
CompuDie Inc.
Wire EDM Service
"Marcel Janmaat" wrote in message
news:5106019@discussion.autodesk.com...
Hi,

Could someone remind me on how to make a list of the drawings wich are
opened in an AutoCAD session.

M
Message 4 of 8
Anonymous
in reply to: Anonymous

Hi,

I found some other posts aswell. I'm using this now;

(defun OpenDwgs (/ Rtn) (vlax-for x (vla-get-Documents
(vlax-get-acad-object)) (setq Rtn (cons (vla-get-name x) Rtn))) (reverse
Rtn))

Only I don't know how to turn the drawingnames to uppercase.

Do you?

M


"Dann Brower" schreef in bericht
news:5106032@discussion.autodesk.com...
maybe like:

;;Usage (setq docslist(DBGetDocsList))
(defun DBGetDocsList (/ docs inc docslist)
(setq docs (vla-get-Documents (vlax-get-object "AutoCad.Application"))
inc 0
docslist (list)
)
(repeat (vla-get-count docs)
(setq docslist (append docslist (list (vla-item docs inc)))
inc (+ inc 1)
)
)
docslist
)


--
Dann M Brower
CompuDie Inc.
Wire EDM Service
"Marcel Janmaat" wrote in message
news:5106019@discussion.autodesk.com...
Hi,

Could someone remind me on how to make a list of the drawings wich are
opened in an AutoCAD session.

M
Message 5 of 8
Anonymous
in reply to: Anonymous

Sure,

(defun OpenDwgs (/ Rtn)
(vlax-for x (vla-get-Documents
(vlax-get-acad-object)
)
(setq Rtn (cons (strcase(vla-get-name x)) Rtn))
)
(reverse
Rtn
)
)






--
Dann M Brower
CompuDie Inc.
Wire EDM Service
"Marcel Janmaat" wrote in message
news:5106262@discussion.autodesk.com...
Hi,

I found some other posts aswell. I'm using this now;

(defun OpenDwgs (/ Rtn) (vlax-for x (vla-get-Documents
(vlax-get-acad-object)) (setq Rtn (cons (vla-get-name x) Rtn))) (reverse
Rtn))

Only I don't know how to turn the drawingnames to uppercase.

Do you?

M


"Dann Brower" schreef in bericht
news:5106032@discussion.autodesk.com...
maybe like:

;;Usage (setq docslist(DBGetDocsList))
(defun DBGetDocsList (/ docs inc docslist)
(setq docs (vla-get-Documents (vlax-get-object "AutoCad.Application"))
inc 0
docslist (list)
)
(repeat (vla-get-count docs)
(setq docslist (append docslist (list (vla-item docs inc)))
inc (+ inc 1)
)
)
docslist
)


--
Dann M Brower
CompuDie Inc.
Wire EDM Service
"Marcel Janmaat" wrote in message
news:5106019@discussion.autodesk.com...
Hi,

Could someone remind me on how to make a list of the drawings wich are
opened in an AutoCAD session.

M
Message 6 of 8
Anonymous
in reply to: Anonymous

(mapcar 'strcase (OpenDwgs))
Message 7 of 8
Anonymous
in reply to: Anonymous

Thanx!!

"Dann Brower" schreef in bericht
news:5106277@discussion.autodesk.com...
Sure,

(defun OpenDwgs (/ Rtn)
(vlax-for x (vla-get-Documents
(vlax-get-acad-object)
)
(setq Rtn (cons (strcase(vla-get-name x)) Rtn))
)
(reverse
Rtn
)
)






--
Dann M Brower
CompuDie Inc.
Wire EDM Service
"Marcel Janmaat" wrote in message
news:5106262@discussion.autodesk.com...
Hi,

I found some other posts aswell. I'm using this now;

(defun OpenDwgs (/ Rtn) (vlax-for x (vla-get-Documents
(vlax-get-acad-object)) (setq Rtn (cons (vla-get-name x) Rtn))) (reverse
Rtn))

Only I don't know how to turn the drawingnames to uppercase.

Do you?

M


"Dann Brower" schreef in bericht
news:5106032@discussion.autodesk.com...
maybe like:

;;Usage (setq docslist(DBGetDocsList))
(defun DBGetDocsList (/ docs inc docslist)
(setq docs (vla-get-Documents (vlax-get-object "AutoCad.Application"))
inc 0
docslist (list)
)
(repeat (vla-get-count docs)
(setq docslist (append docslist (list (vla-item docs inc)))
inc (+ inc 1)
)
)
docslist
)


--
Dann M Brower
CompuDie Inc.
Wire EDM Service
"Marcel Janmaat" wrote in message
news:5106019@discussion.autodesk.com...
Hi,

Could someone remind me on how to make a list of the drawings wich are
opened in an AutoCAD session.

M
Message 8 of 8
Anonymous
in reply to: Anonymous

Your welcome 🙂

--
Dann M Brower
CompuDie Inc.
Wire EDM Service
"Marcel Janmaat" wrote in message
news:5106286@discussion.autodesk.com...
Thanx!!

"Dann Brower" schreef in bericht
news:5106277@discussion.autodesk.com...
Sure,

(defun OpenDwgs (/ Rtn)
(vlax-for x (vla-get-Documents
(vlax-get-acad-object)
)
(setq Rtn (cons (strcase(vla-get-name x)) Rtn))
)
(reverse
Rtn
)
)






--
Dann M Brower
CompuDie Inc.
Wire EDM Service
"Marcel Janmaat" wrote in message
news:5106262@discussion.autodesk.com...
Hi,

I found some other posts aswell. I'm using this now;

(defun OpenDwgs (/ Rtn) (vlax-for x (vla-get-Documents
(vlax-get-acad-object)) (setq Rtn (cons (vla-get-name x) Rtn))) (reverse
Rtn))

Only I don't know how to turn the drawingnames to uppercase.

Do you?

M


"Dann Brower" schreef in bericht
news:5106032@discussion.autodesk.com...
maybe like:

;;Usage (setq docslist(DBGetDocsList))
(defun DBGetDocsList (/ docs inc docslist)
(setq docs (vla-get-Documents (vlax-get-object "AutoCad.Application"))
inc 0
docslist (list)
)
(repeat (vla-get-count docs)
(setq docslist (append docslist (list (vla-item docs inc)))
inc (+ inc 1)
)
)
docslist
)


--
Dann M Brower
CompuDie Inc.
Wire EDM Service
"Marcel Janmaat" wrote in message
news:5106019@discussion.autodesk.com...
Hi,

Could someone remind me on how to make a list of the drawings wich are
opened in an AutoCAD session.

M

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

Post to forums  

Autodesk Design & Make Report

”Boost