Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
How to use vla-close ?
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: How to use vla-close ? (Read 632 times)
0 Members and 1 Guest are viewing this topic.
domenicomaria
Swamp Rat
Posts: 725
How to use vla-close ?
«
on:
March 28, 2023, 12:22:39 PM »
I apologize if the question is perhaps too stupid. . .
but I need, with vlisp, to close an opened dwg file by another (active) dwg file. . .
how you do it ?
How to use vla-close ?
Logged
ribarm
Gator
Posts: 3274
Marko Ribar, architect
WWW
Re: How to use vla-close ?
«
Reply #1 on:
March 28, 2023, 12:34:37 PM »
You mean command : CLOSE ?
Logged
Marko Ribar, d.i.a.
(graduated engineer of architecture)
M.R. on Youtube
ribarm
Gator
Posts: 3274
Marko Ribar, architect
WWW
Re: How to use vla-close ?
«
Reply #2 on:
March 28, 2023, 12:47:40 PM »
Untested...
Code - Auto/Visual Lisp:
[Select]
(
defun
closeallbutactive
(
/
cad
)
(
vl-load-com
)
(
vlax-for
doc
(
vla-get-documents
(
setq
cad
(
vlax-get-acad-object
)
)
)
(
if
(
not
(
equal
(
vla-get-activedocument
cad
)
doc
)
)
(
vla
-
close
doc
)
)
)
(
princ
)
)
HTH.
M.R.
«
Last Edit: March 28, 2023, 12:57:17 PM by ribarm
»
Logged
Marko Ribar, d.i.a.
(graduated engineer of architecture)
M.R. on Youtube
domenicomaria
Swamp Rat
Posts: 725
Re: How to use vla-close ?
«
Reply #3 on:
March 28, 2023, 12:55:24 PM »
It says :
Automation Error. Drawing is busy.
Logged
ribarm
Gator
Posts: 3274
Marko Ribar, architect
WWW
Re: How to use vla-close ?
«
Reply #4 on:
March 28, 2023, 12:58:19 PM »
Quote from: domenicomaria on March 28, 2023, 12:55:24 PM
It says :
Automation Error. Drawing is busy.
It was because of line 6.
should be (equal) instead of (eq) that was before I altered function...
Logged
Marko Ribar, d.i.a.
(graduated engineer of architecture)
M.R. on Youtube
domenicomaria
Swamp Rat
Posts: 725
Re: How to use vla-close ?
«
Reply #5 on:
March 28, 2023, 01:21:45 PM »
Marko, thank you very much!
It works !
Today I lost a couple of hours,
and I don't understand (now) why I didn't succeed !
Now it seems incredibly simple to me! (now !)
My brain is aging !
Thank you.
ciao
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
How to use vla-close ?