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

open drawing 'read-only' - lisp

10 REPLIES 10
Reply
Message 1 of 11
jlaidler
1906 Views, 10 Replies

open drawing 'read-only' - lisp

How can you open a drawing read-only with autolisp.
10 REPLIES 10
Message 2 of 11
tom_brabant
in reply to: jlaidler

this seems to do it

(vla-open (vla-get-documents (vlax-get-acad-object)) "c:/temp/test.dwg" :vlax-true)
Message 3 of 11
jlaidler
in reply to: jlaidler

thanks... that works great.
Message 4 of 11
jlaidler
in reply to: jlaidler

One other thing.... how can I get the read-only drawing to be active??
Message 5 of 11
tom_brabant
in reply to: jlaidler

This could do it, but, it just assumes that the most recently opened document is in the "front" of the documents collection. Also, take care: when I loaded this text from the vlisp text editor using "load text in editor" I lost control of the VLIDE until I manually (acad side with mouse) made the original document active again.



(vla-open (vla-get-documents (vlax-get-acad-object)) "c:/temp/test.dwg" :vlax-true)
(setq doclis nil)
(setq acad (vlax-get-acad-object))
(setq docs (vla-get-documents acad))
(vlax-for doc docs (setq doclis (cons doc doclis)))
(vla-activate (car doclis))
Message 6 of 11
tom_brabant
in reply to: jlaidler

Oops! make that the "back" of the collection: the way I wrote that means the lisp list doclis will be in the _reverse_ order of the documents collection.
Message 7 of 11
jrodriguez
in reply to: jlaidler

with this routine.... how can i get a dialog box to open up just the same way as open does. I'm looking to make a read-only open button that works the same way as open does???

any ideas

thanks
JRodriguez
Message 8 of 11
EC-CAD
in reply to: jlaidler

Now you only took a year and 8 months. Progress.
Bob
Message 9 of 11
jrodriguez
in reply to: jlaidler

LOL

hehehehehehee once again not the originator.... just beginin to look into this now..

LOL

i bet we talk again on another one or two of the same topics. LOL

thanks again ECCAD
JRodriguez
Message 10 of 11
EC-CAD
in reply to: jlaidler

See the other post.

Bob
Message 11 of 11
alan_tuck
in reply to: jlaidler

You don't need the loop, a more efficient way of doing it is:

 

(vla-open (vla-get-documents (vlax-get-acad-object)) "c:/temp/test.dwg" :vlax-true)
 (setq docs (vla-get-documents (vlax-get-acad-object)))
 (vla-activate  (vla-item docs (1- (vla-get-count docs))))

Tags (1)

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

Post to forums  

Autodesk Design & Make Report

”Boost