Program behaves differently when loaded through macro

Program behaves differently when loaded through macro

Anonymous
Not applicable
591 Views
0 Replies
Message 1 of 1

Program behaves differently when loaded through macro

Anonymous
Not applicable

I developed the attached lisp to quickly detect what discipline a drawing is for (this is based on the file structure we use at work) and then set the colour for all xrefed layers that are not from that discipline to 8 and freeze them off except for a short list of layers that we want left on for coordination purposes. It's a short simple tool to speed up our process of referencing in the other services to coordinate the ceiling space and it has been working well for a while. We usually use it through a button on a custom ribbon in our cui which runs the following macro:

^C^C(LOAD "filepathtolispfile/DISCIPLINE_XREF_FREEZE.lsp");DLF;

I've noticed that when the button is pressed pretty much everything that you'd expect happens, however objects on the layer F-NEWSYMBOLS in the attached xrefs are still visible (they have been coloured to 8). Naturally I went to see if that layer name had accidentally been added to the list of layers to be thawed, but it had not.

My real confusion began when I copied the code for the command definition directly into my autocad session from the exact file that is being loaded by the macro. Then when I ran the command by typing in the name the F-NEWSYMBOLS layer became correctly frozen. Then pressed the button on the ribbon again and it thawed the layer again.

So I'm getting different behaviors from this program when it is loaded from a macro and when I paste the code directly into the session. Anyone have any ideas what could cause that?

0 Likes
592 Views
0 Replies
Replies (0)