Doubts for vl-close

Doubts for vl-close

carlos_m_gil_p
Advocate Advocate
843 Views
6 Replies
Message 1 of 7

Doubts for vl-close

carlos_m_gil_p
Advocate
Advocate

Hello boys. How are you.

Can someone tell me, what is the way to close the current drawing with vl-close.
Thank you.


AutoCAD 2026
Visual Studio Code 1.99.3
AutoCAD AutoLISP Extension 1.6.3
Windows 10 (64 bits)

0 Likes
844 Views
6 Replies
Replies (6)
Message 2 of 7

roland.r71
Collaborator
Collaborator

I'll presume you mean: vlA-close... (as vl-close doesn't exist)

 

I'm anything but an expert when it comes to ActiveX, but i'm an expert with google 😛

 

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-ActiveX/files...

0 Likes
Message 3 of 7

carlos_m_gil_p
Advocate
Advocate

Hello how are you.
Thank you for the correction. You're right, it's vla-close.

But I do not get where to edit the post.

Before asking, I had already searched in google.
But I can not solve for vla-close when I need to close the current drawing.

Thank you.


AutoCAD 2026
Visual Studio Code 1.99.3
AutoCAD AutoLISP Extension 1.6.3
Windows 10 (64 bits)

0 Likes
Message 4 of 7

roland.r71
Collaborator
Collaborator

"You cannot close a drawing from inside an event handler for that drawing."

 

This line tells me you can't. (& acad tells me the drawing is busy, when i try)

 

I did find a different aproach (still using VBA)

(command "._VBASTMT" "ThisDrawing.Close False")

Which works for me.

0 Likes
Message 5 of 7

carlos_m_gil_p
Advocate
Advocate

Hi, I saw that, but I do not have that module installed.
And it would be more work, to have to install it.


AutoCAD 2026
Visual Studio Code 1.99.3
AutoCAD AutoLISP Extension 1.6.3
Windows 10 (64 bits)

0 Likes
Message 6 of 7

roland.r71
Collaborator
Collaborator

so... why not use (command "_.close") ?

 

(command "_.close" (if (/= (getvar "dbmod") 0) "_Yes"))

 

 

Will do the same.

note: IF the drawing changed it will answer _Yes to the question: "Realy discard changes?"

Message 7 of 7

carlos_m_gil_p
Advocate
Advocate

Hi.
I currently have it like that. (command "_.close")
The purpose was to learn how to use vla-close for an active drawing.

Thank you.


AutoCAD 2026
Visual Studio Code 1.99.3
AutoCAD AutoLISP Extension 1.6.3
Windows 10 (64 bits)

0 Likes