Mara821 Posted May 27, 2019 Posted May 27, 2019 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 Quote
Grrr Posted May 27, 2019 Posted May 27, 2019 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! 1 Quote
Mara821 Posted May 30, 2019 Author Posted May 30, 2019 Thank you very much, it helped. I used vlr-xref-reactor after all, because its callbacks fires before commandEnded callback. Quote
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.