Author Topic: Model space object changes during dcl dialog: possible?  (Read 2336 times)

0 Members and 1 Guest are viewing this topic.

Ben Clark

  • Newt
  • Posts: 94
Model space object changes during dcl dialog: possible?
« on: December 11, 2017, 06:42:45 PM »
Is the manipulation of graphical objects in model space (moving, rotating, etc. by entmod-ing base pt, rotation, and normal) allowed during a dcl dialog?

I keep getting the below error and I think it's because I'm trying to move graphical objects around while keeping a dcl dialog active.

I'd love it if this was possible to do. But I'm not sure why I'm getting this error. Any help?


Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Model space object changes during dcl dialog: possible?
« Reply #1 on: December 11, 2017, 06:53:40 PM »
Assuming standard DCL (i.e. a modal dialog), AutoCAD commands cannot be evaluated whilst the dialog has focus.

kpblc

  • Bull Frog
  • Posts: 396
Re: Model space object changes during dcl dialog: possible?
« Reply #2 on: December 11, 2017, 11:56:14 PM »
Use non-command methods (entmod, vla-...)
Sorry for my English.

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Model space object changes during dcl dialog: possible?
« Reply #3 on: December 12, 2017, 07:53:42 PM »
Alternatively, you can use something like ObjectDCL, which I believe does have such an ability. Just be forewarned if you go that route, Autodesk has been breaking API compatibility every couple of years lately and you will be left without being able to use your customization until ObjectDCL is updated for the latest version.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2138
  • class keyThumper<T>:ILazy<T>
Re: Model space object changes during dcl dialog: possible?
« Reply #4 on: December 13, 2017, 03:31:19 AM »
Alternatively, you can use something like ObjectDCL, which I believe does have such an ability. Just be forewarned if you go that route, Autodesk has been breaking API compatibility every couple of years lately and you will be left without being able to use your customization until ObjectDCL is updated for the latest version.

Owen has been very punctual with releases for AutoCAD and BricsCad ... No reason to expect that will change.
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: Model space object changes during dcl dialog: possible?
« Reply #5 on: December 13, 2017, 08:56:58 AM »
You could try temporary closing and reopening the dialog within a (while) loop, where the command calls are called outside of it.
But I think that would result in a quick flash (due the close'n'open), when using these certain tiles.
Lee demonstrated such technique, although with a slightly different purpose: to prompt the user for something outside of the dialog, and then return back into the dialog.
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)
vevo.bg

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Model space object changes during dcl dialog: possible?
« Reply #6 on: December 13, 2017, 04:37:16 PM »
What @LeeMac said.

You could momentarily hide the dialog, do you on screen action, and then restore the dialog.

It's sort of documented here: "Note: You cannot call the AutoLISP command function from the action_tile function."
I say sort of, because in the context of this statement, I believe that "command function" really means anything that interacts with the graphics screen.

I can't even get it to do a GRDRAW while the dialog has focus. As soon as the dialog is cancelled, the GRDRAW shows up though.

The following essentially says that the O/S takes over at some point, awaiting user input, during which nothing can be done in CAD.

"Caution: In theory, the dialog box facility takes control of input at the time you call start_dialog, but the operating system takes control when you call new_dialog. This has no effect on writing programs. However, if you invoke these functions interactively (at the AutoCAD Command prompt), you must enter them as one statement. Enclose them within a progn or another function. If you do not, the interactive call to new_dialog can freeze the screen. Calling new_dialog and start_dialog interactively can be useful during debugging."

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: Model space object changes during dcl dialog: possible?
« Reply #7 on: December 13, 2017, 06:39:31 PM »
I can't even get it to do a GRDRAW while the dialog has focus. As soon as the dialog is cancelled, the GRDRAW shows up though.
i can not confirm that
what version of autocad are you using?

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Model space object changes during dcl dialog: possible?
« Reply #8 on: December 14, 2017, 07:34:47 AM »
Quote from: VovKa
i can not confirm that
what version of autocad are you using?

2014, 2015, 2016, 2017 & 2018.

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: Model space object changes during dcl dialog: possible?
« Reply #9 on: December 14, 2017, 07:59:00 AM »
2014, 2015, 2016, 2017 & 2018.
this is strange
i tested it on 2004, 2007, 2012 and it worked just fine
also i have not got any bug reports on my app which draws boundaries both with grdraw/grvecs and entmake while the dcl is active

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Model space object changes during dcl dialog: possible?
« Reply #10 on: December 14, 2017, 08:51:33 AM »
Well, I was probably doing it wrong then.

In this case, maybe OP can do his/her drawing with GRVECS/GRDRAW - then when the DCL is closed, create the actual geometry.