Hello every one
i work with OpenCL to make modeless dialogue
but I've a problem in using (command ....) any AutoCAD commands don't work with the OpenCL
then i tried to make entmake but it make the AutoCAD give error and closed
can any one help me with example how to handle with the command inside the OpenCL??
thanks in advance
and see the attached dcl file and lisp and dwg ..
@S_S_SS hi,
i do not have openDCl installed here (can not check) but you can not use (command) function while dialog box is open (same as using dcl) so (entmake) is good approach.
inside (secleader) function there is free string??? put it on remark
the rest of the code seems working 😀
Moshe
(defun secledger (blockName insPoint rotation / )
"Function to insert a block with given parameters."
;; التØقق من وجود البلوك ÙÙŠ الرسم
(if (not (tblsearch "BLOCK" blockName))
(alert (strcat "Block \"" blockName "\" not found!"))
(progn
As i said do not have openDCL installed.
if you manually call from VLIDE console or command line (secledger) function does it work?
it look like you did not understand what is ask you to do
i want you to copy & paste (to a new lsp file) the function (secledger) load it into memory and manually run the following 2 lines
(from VLIDE console or AutoCAD command line)
(setq pt1 (getpoint "\nSelect insertion point: "))
(secledger "cuplock plan" pt1 0)
on my computer it works
Moshe
Hello sir
see this code it's work correctly
(defun c:hh (/)
(setq pt3 (getpoint "\nSelect insertion point: "))
(entmake
(list
'(0 . "INSERT")
(cons 2 "cuplock plan")
(cons 10 pt3)
(cons 41 1)
(cons 42 1)
(cons 43 1)
(cons 50 (* pi (/ 0 180.0)))
)
)
)
and when i put it in the opendcl like this it make AutoCAD closed immediately
(defun c:Untitled/Form2/TextButton2#OnClicked (/)
(setq pt3 (getpoint "\nSelect insertion point: "))
(entmake
(list
'(0 . "INSERT")
(cons 2 "cuplock plan")
(cons 10 pt3)
(cons 41 1)
(cons 42 1)
(cons 43 1)
(cons 50 3)
)
)
)
see the video here
thanks in advance
The error shows that you need to lock the document
https://opendcl.com/forum/index.php?topic=1232.0
I have no idea how to do this in Lisp though.
Can't find what you're looking for? Ask the community or share your knowledge.