Author Topic: Error is there a solution?  (Read 26914 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Error is there a solution?
« Reply #30 on: January 10, 2009, 09:14:53 AM »
The reactor code must be loaded in each DWG so ACADDOC.lsp or any other lisp that is loaded at the start of each DWG.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Error is there a solution?
« Reply #32 on: January 10, 2009, 03:11:18 PM »
The problem with a reactor is that it cannot STOP the CLOSE COMMAND.

As I see it your options are:
Redefine the CLOSE command and make it the NewClose.lsp with some mods.

Use a reactor to detect the CLOSE command & create a report of the error.

Use a reactor to fix the block names before completing the Close Command.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

cadmoogle

  • Guest
Re: Error is there a solution?
« Reply #33 on: January 11, 2009, 10:08:44 AM »
If you redefine the close command how does AutoCAD know to close? Also what if you wanted to bring back the old close command?

Thanks,
Daniel

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Error is there a solution?
« Reply #34 on: January 11, 2009, 12:27:51 PM »
From the Help File
Quote
REDEFINE
Restores AutoCAD internal commands overridden by UNDEFINE

Command line: redefine

Enter command name:  Enter the name of an AutoCAD command turned off by the UNDEFINE command 

If a command has been undefined, you can still use it if you precede the command name with a period.

You can override a redefines command by placing a period in front of the command like this ".CLOSE"
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Error is there a solution?
« Reply #35 on: January 11, 2009, 12:30:19 PM »
To redefine the close command you would just rename your routine  c:NewClose to c:Close
This would override the close command unless the user used .close
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

cadmoogle

  • Guest
Re: Error is there a solution?
« Reply #36 on: January 12, 2009, 08:42:21 AM »
I tested both versions of the code this, with the first version I get the following message

Quote
; error: bad argument value: does not fit in byte: 1489

I've yet to test CAB's version with my list of blocks.

cadmoogle

  • Guest
Re: Error is there a solution?
« Reply #37 on: January 12, 2009, 09:57:48 AM »
Mine errors with the above statement, CABs version says the string is too long on input.

Ron's works but it takes a while to run. Is it possible to speed it up? It takes about 5 more like 10 :cry:seconds for it to pop up with the warning.
« Last Edit: January 12, 2009, 11:42:26 AM by cadmoogle »

cadmoogle

  • Guest
Re: Error is there a solution?
« Reply #38 on: January 12, 2009, 11:33:31 AM »
Ron is it possible to speed the command up? If no blocks are in the drawing it's quick, but the second more blocks appear it drags. If it were quicker this would do. It works as intended. Maybe a counter/progress bar would help if it could not be sped up? The second I load this onto the machines they're going to complain about closing time. Thank you.

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Error is there a solution?
« Reply #39 on: January 12, 2009, 12:04:05 PM »
Try using this function instead...since you are not doing anything with the selection set, I made it stop looking at the first found occurrence and return T.
Code: [Select]
(defun manyblocknames2ss (blocklist / n ss)
  (setq n -1)
  (while (and (nth (setq n (1+ n)) blocklist)
              (not
                (setq ss (ssget "_x"
                                (list (cons 0 "INSERT") (cons 2 (nth n blocklist)))
                         )
                )
              )
         )
  )
  (and ss)
)
« Last Edit: January 12, 2009, 01:13:49 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Error is there a solution?
« Reply #40 on: January 12, 2009, 12:19:51 PM »
Perhaps it would be faster to group the block names & do fewer ssget's.

It may be faster to ssget all INSERTS & compare there name to the list.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Error is there a solution?
« Reply #41 on: January 12, 2009, 12:21:20 PM »
Perhaps it would be faster to group the block names & do fewer ssget's.

It may be faster to ssget all INSERTS & compare there name to the list.

You're probably right.  :-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Error is there a solution?
« Reply #42 on: January 12, 2009, 12:23:36 PM »
Ron your routine will lock in the loop if there are no hits, right?


PS just tested it & errors out if no hits.
Just need a test for end of list, but good idea though.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Error is there a solution?
« Reply #43 on: January 12, 2009, 12:34:38 PM »
You are correct senor CAB...I updated the code above to check that the counter is less than list length..then it ends.  :-)

That errors too...I should just quit now :-D
« Last Edit: January 12, 2009, 12:39:48 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

cadmoogle

  • Guest
Re: Error is there a solution?
« Reply #44 on: January 12, 2009, 01:02:55 PM »
I ran the updated copy and the following happens,

first it lags my machine then prompts this

Quote
; error: bad SSGET list value