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

Handling with Opendcl with modeless dialogue

12 REPLIES 12
Reply
Message 1 of 13
S_S_SS
338 Views, 12 Replies

Handling with Opendcl with modeless dialogue

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 .. 

12 REPLIES 12
Message 2 of 13
Moshe-A
in reply to: S_S_SS

@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

Message 3 of 13
S_S_SS
in reply to: Moshe-A

thanks sir
but enmake make the AutoCAD gives error and terminal closes
Message 4 of 13
Moshe-A
in reply to: S_S_SS

As i said do not have openDCL installed.

if you manually call from VLIDE console  or command line (secledger) function does it work?

 

 

Message 5 of 13
S_S_SS
in reply to: Moshe-A

unfortunately it doesn't work
Message 6 of 13
Moshe-A
in reply to: S_S_SS

post the error you are getting

Message 7 of 13
S_S_SS
in reply to: Moshe-A

S_S_SS_0-1736078045104.pngS_S_SS_1-1736078388273.png

 

Message 8 of 13
Moshe-A
in reply to: S_S_SS

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

 

Message 9 of 13
S_S_SS
in reply to: Moshe-A

I understand you now
this function secledger works but it ask me to get point and then i should press enter to execute the insert
even the insert command don't ask me to press enter to execute the insert
and it make error in insert the other items
I'll record a video to show you what i see
Message 10 of 13
Moshe-A
in reply to: S_S_SS

@S_S_SS,

 

To trap the error, you must isolate the part of code that trigger it.

i do not think it comes from (entmake) but from the call before or after.

 

Moshe

 

 

Message 11 of 13
S_S_SS
in reply to: Moshe-A

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 

Message 12 of 13
Sea-Haven
in reply to: S_S_SS

Message 13 of 13
daniel_cadext
in reply to: S_S_SS

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.

https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-RefGuide-AcApDocManager__lockDocument_AcApDo...

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report