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

Create a new drawing from LISP

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
280 Views, 4 Replies

Create a new drawing from LISP

I want to create a new drawing from a LISP routine, and i use the follow
command:

(command "._vbastmt" "ThisDrawing.Application.Documents.Add"),

but AutoCad said unknown vbastmt command.

Response from AutoCad:

Unknown command "._VBASTMT". Press F1 for help.
Unknown command "THISDRAWING.APPLICATION.DOCUMENTS.ADD". Press F1 for
help.
nil

What can i do?

I wait a reply from you ASAP.
Many thanks,
Lucian :o)

P.S. Dear Rodney, i load acadvba.arx and AutoCad said that i haven't VBA
installed in my computer. I knew that i use it that command in a past
and i haven't VBA installed on my computer.
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

I do this to create a new drawing. The fullname variable is the full path
and file name ["k:\\mydir\\docs\\myfile.dwg"] and the filename is the file
name ["myfile.dwg"]

(setq
doc (vla-get-templateDWGPath (vla-get-Files (vla-get-preferences
(vlax-get-acad-object))))
doc (findfile (strcat doc "\\acad.dwt"))
doc (vla-add (vla-get-documents (vlax-get-acad-object)) doc)
)
(vla-saveAs doc fullname)
(vla-activate (vla-item (vla-get-documents (vlax-get-acad-object))
filename))
)
--
Cliff
Message 3 of 5
Anonymous
in reply to: Anonymous

I do this to create a new drawing. The fullname variable is the full path
and file name ["k:\\mydir\\docs\\myfile.dwg"] and the filename is the file
name ["myfile.dwg"]

(setq
doc
(vla-get-templateDWGPath
(vla-get-Files
(vla-get-preferences
(vlax-get-acad-object))))
doc (findfile (strcat doc "\\acad.dwt"))
doc
(vla-add
(vla-get-documents
(vlax-get-acad-object)) doc))
(vla-saveAs doc fullname)
(vla-activate
(vla-item
(vla-get-documents (vlax-get-acad-object))
filename))
)
--
Cliff
Message 4 of 5
KingCAD
in reply to: Anonymous

Thanks Cliff, I will be sure to give this a try. If I can get my desk cleared off enough to get back to it!
Again I thank you for your responce and I appologise for the delay in my responce.
Dave. K
Message 5 of 5
KingCAD
in reply to: Anonymous

OOPS _ my appologise I just realised I responded to the rong post. Man do I need a vacation.
SORRY ABOUT THAT
Dave. K

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

Post to forums  

Autodesk Design & Make Report

”Boost