Anushka Posted August 16, 2019 Share Posted August 16, 2019 I'm trying to apply an action to a button to insert a block, but I get an error exception in veval-str+ arx command unhandled Can someone help me solve the problem? subfunction and how am i applying the action (defun Inblk ( name* tag1 tag2 ) (if (not (tblsearch "BLOCK" name*)) (command "_insert" name* pause "" "" "" tag1 tag2) ) ) " : butt { key = \"bt01\"; label = \"9.300\"; }" (action_tile "bt01" "(Inblk \"D_Poste\"\"9/300\" nil ) (done_dialog 1)") Quote Link to comment Share on other sites More sharing options...
dlanorh Posted August 16, 2019 Share Posted August 16, 2019 You are trying to run a command ("_insert") inside a modal dialog. Quote Link to comment Share on other sites More sharing options...
Anushka Posted August 16, 2019 Author Share Posted August 16, 2019 (edited) 7 minutes ago, dlanorh said: You are trying to run a command ("_insert") inside a modal dialog. it's a problem? vla-SendCommand it works ? Edited August 16, 2019 by Anushka Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted August 16, 2019 Share Posted August 16, 2019 Yes. You can't do this. See also: http://help.autodesk.com/view/ACD/2020/ENU/?guid=GUID-EA46DBF6-227F-409E-ABBB-DFC8CCE2C82F If you need the user to interact with the dialog further, then hide it, then restore it. Otherwise, close the dialog before trying to do any commands, as described in the link above. 1 Quote Link to comment Share on other sites More sharing options...
dlanorh Posted August 16, 2019 Share Posted August 16, 2019 1 hour ago, Anushka said: it's a problem? vla-SendCommand it works ? No. Nothing works unless the form is hidden as @rkmcswain alluded to above. The "form" is Modal. Nothing will work until it hidden or ended. Are you collecting the exit state from the dialog, as you're using (done_dialog 1). I collect it by using (setq x_val (start_dialog)) Then change (action_tile "bt01" "(Inblk \"D_Poste\"\"9/300\" nil ) (done_dialog 1)") to (action_tile "bt01" "(done_dialog 1)") and after unloading the dialog (cond ( (= x_val 1) (Inblk "D_Poste" "9/300" ""))) You cannot set an attribute 'TEXTSTRING value to nil, it will error so you send it the null string "" If you are doing several block you can store the values in strings eg (action_tile "bt01" "(progn (setq blk \"D_Poste\" t1 \"9/300\" t2 "") (done_dialog 1))") Then (cond ( (= x_val 1) (Inblk blk t1 t2))) 1 Quote Link to comment Share on other sites More sharing options...
Anushka Posted August 20, 2019 Author Share Posted August 20, 2019 @dlanorh Thank you it worked !!! 1 Quote Link to comment Share on other sites More sharing options...
dlanorh Posted August 20, 2019 Share Posted August 20, 2019 3 hours ago, Anushka said: @dlanorh Thank you it worked !!! You're welcome. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.