Jump to content

Recommended Posts

Posted

Hi,

I have command reactor for seting global coordinate system and other stuff if I use command xattach. I would like create error trap for pressing cancel button while opening xref file. For cancel button in "Attach External Reference" dialog is easy, I use variable "DIASTAT", but this doesnť work for open dialog (see Reference manual). :vlr-commandCancelled doesn't catch pressing cancel buton and :vlr-commandended is triggered. I know i can create function with  using (getfiled) but i would like stay with reactors. So is there way how I can get pressing of cancel button?

 

Thanks

Posted

Hi, 

When you interrupt the secondary dialog box "Select Reference File" with cancel or the [X] button, you'll get the following events triggered (and a sample arguments that they have) -

:VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 00000017039a28c8> 4 2 4 "#XATTACH")
:VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 00000017039a28c8> 4 2 2 "#XATTACH")

However if you choose a (dwg) file and get into the third dialog box "Attach External Reference", and cancel or [X]-it it... then you'll get -

.. some events ...
:VLR-dwgFileOpened . (#<VLA-OBJECT IAcadDatabase 000000170166a768> "C:\\<Path>\\Test.dwg")
.. some events ...
:VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 00000017039a28c8> 4 2 4 "#XATTACH")
:VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 00000017039a28c8> 4 2 2 "#XATTACH")

 

Finally if you are able to attach the dwg, then you'll get -

... bunch of object opened, appended, modified events...
:VLR-xrefSubcommandAttachItem . (4 nil)
.. some more events...
:VLR-commandEnded . ("XATTACH")
:VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 00000017039a28c8> 4 1 4 "#XATTACH")
:VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 00000017039a28c8> 4 1 2 "#XATTACH")

 

Good Luck! 👨‍🔧

  • Thanks 1
Posted

Thank you very much, it helped. I used vlr-xref-reactor after all, because its callbacks fires before commandEnded callback.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...