VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD Bug or VBA Bug or LISP Bug ???

13 REPLIES 13
Reply
Message 1 of 14
Anonymous
378 Views, 13 Replies

AutoCAD Bug or VBA Bug or LISP Bug ???

Can anyone confirm the following bug and where it's coming from ? 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a temp dir 2. Regsvr32 DLLTest.dll 3. Load AutoCAD 2000-2002 (it also happens with 2004 and 2005, just change the reference lib in the dll project and recompile) 4. Select "Start from Scratch", "metric" 5. Load the lisp "DLLtest.lsp" 6. write DIMSCALE, and enter a value of 1.8 7. Use the DIMENSION menu and select LINEAR. Dim any two points 8. Use the DIMENSION menu and select CONTINUE. Move the cursor and watch the dimcontinue command go bezerk !! Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the dimcontinue works again !! The zip includes the source for the VB6 dlltest.dll TIA -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica (sorry, phony e-mail, SPAM made me do it)
13 REPLIES 13
Message 2 of 14
Anonymous
in reply to: Anonymous

Jorge - The fact that this happens is not something I would find shocking. Generally, making changes to the database in events like the ones you're using, can lead to unpredicable behavior. One reason why (but not necessarily the one that is causing this particular problem), is because many AutoCAD commands, especially older ones, locally cache things like the active layer and other relevant data used in the creation of new entities. So, in fact, changing the active layer after the fact, can actually be ignored by some commands because they may have already made a local copy of the value of the CLAYER system variable. Of course, it can depend on the mechanics of the command, and when the reactor/event is fired, but generally, doing the kind of things you're doing entails the risk of unpredicable behavior, on a command-specific basis. -- http://www.caddzone.com AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 http://www.acadxtabs.com "Jorge Jimenez" wrote in message news:40a96ad2_2@newsprd01... > Can anyone confirm the following bug and where it's coming from ? > > 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a temp dir > 2. Regsvr32 DLLTest.dll > 3. Load AutoCAD 2000-2002 (it also happens with 2004 and 2005, just change > the reference lib in the dll project and recompile) > 4. Select "Start from Scratch", "metric" > 5. Load the lisp "DLLtest.lsp" > 6. write DIMSCALE, and enter a value of 1.8 > 7. Use the DIMENSION menu and select LINEAR. Dim any two points > 8. Use the DIMENSION menu and select CONTINUE. Move the cursor and watch > the dimcontinue command go bezerk !! > > Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the dimcontinue > works again !! > > The zip includes the source for the VB6 dlltest.dll > > TIA > -- > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > (sorry, phony e-mail, SPAM made me do it) > > >
Message 3 of 14
Anonymous
in reply to: Anonymous

I can confirm that bug. I think it's the dimcontinue and/or dimlinear command that has a bug. Some time ago I tried to rewrite my dim lisp to use the Dimlinear command name followed by Dimcontinue. It wouldn't work so i had to continue using (Command "dim" "hor" (or "ver") .... - followed by (while (/= (logand (getvar "cmdactive") 1) 0) (initget "Continue Done") (setq resp (getkword "\nContinue or Done? ")) (while (or (not resp)(= resp "Continue")) (command "cont" pause "") instead of (command "dimlinear" ... (while (/= (logand (getvar "cmdactive") 1) 0) (initget "Continue Done") (setq resp (getkword "\nContinue or Done? ")) (if (or (not resp)(= resp "Continue")) (command "dimcontinue" pause) );if "Jorge Jimenez" wrote in message news:40a96ad2_2@newsprd01... > Can anyone confirm the following bug and where it's coming from ?
Message 4 of 14
Anonymous
in reply to: Anonymous

Thanks for the reply Tony. Actually, the real dll does not change the layer at the begincommand event, it stores a count of the entities at the moment the command begins, and then compares that count with the count at the endcommand event. Then it changes the layer of the new entities. The problems happens no matter how this is done. I agree with you about the cache factor, but the fact that it only happens with certain values of the dimscale variable makes this behavior quite different. I made this test dll as simple as possible to make sure everyone could see the behavior without thinking it could be some other event going on. I even took out the change layer code in the events, and the problem persited. -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica (sorry, phony e-mail, SPAM made me do it) "Tony Tanzillo" wrote in message news:40a979d4$1_3@newsprd01... > Jorge - The fact that this happens is not something > I would find shocking. > > Generally, making changes to the database in events > like the ones you're using, can lead to unpredicable > behavior. One reason why (but not necessarily the one > that is causing this particular problem), is because > many AutoCAD commands, especially older ones, locally > cache things like the active layer and other relevant > data used in the creation of new entities. So, in fact, > changing the active layer after the fact, can actually > be ignored by some commands because they may have > already made a local copy of the value of the CLAYER > system variable. > > Of course, it can depend on the mechanics of the > command, and when the reactor/event is fired, but > generally, doing the kind of things you're doing > entails the risk of unpredicable behavior, on a > command-specific basis. > > > -- > http://www.caddzone.com > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > http://www.acadxtabs.com > > > "Jorge Jimenez" wrote in message news:40a96ad2_2@newsprd01... > > Can anyone confirm the following bug and where it's coming from ? > > > > 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a temp dir > > 2. Regsvr32 DLLTest.dll > > 3. Load AutoCAD 2000-2002 (it also happens with 2004 and 2005, just change > > the reference lib in the dll project and recompile) > > 4. Select "Start from Scratch", "metric" > > 5. Load the lisp "DLLtest.lsp" > > 6. write DIMSCALE, and enter a value of 1.8 > > 7. Use the DIMENSION menu and select LINEAR. Dim any two points > > 8. Use the DIMENSION menu and select CONTINUE. Move the cursor and watch > > the dimcontinue command go bezerk !! > > > > Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the dimcontinue > > works again !! > > > > The zip includes the source for the VB6 dlltest.dll > > > > TIA > > -- > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > >
Message 5 of 14
Anonymous
in reply to: Anonymous

Hi Mark, thanks for the reply. I remember this command having strange problems since R12 and it was fixed in later versions. But the fact that the ONLY command that seems to go bezerk using this DLL is the DIMCONTINUE, makes me wonder if it was really fixed. -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica (sorry, phony e-mail, SPAM made me do it) "Mark Propst" wrote in message news:40a97bcc_1@newsprd01... > I can confirm that bug. > I think it's the dimcontinue and/or dimlinear command that has a bug. > > Some time ago I tried to rewrite my dim lisp to use the Dimlinear command > name followed by Dimcontinue. > It wouldn't work so i had to continue using > (Command "dim" > "hor" (or "ver") .... > - followed by > (while (/= (logand (getvar "cmdactive") 1) 0) > (initget "Continue Done") > (setq resp (getkword "\nContinue or Done? ")) > (while (or (not resp)(= resp "Continue")) > (command "cont" pause "") > > instead of > (command "dimlinear" ... > (while (/= (logand (getvar "cmdactive") 1) 0) > (initget "Continue Done") > (setq resp (getkword "\nContinue or Done? ")) > (if (or (not resp)(= resp "Continue")) > (command "dimcontinue" pause) > );if > > "Jorge Jimenez" wrote in message > news:40a96ad2_2@newsprd01... > > Can anyone confirm the following bug and where it's coming from ? > >
Message 6 of 14
Anonymous
in reply to: Anonymous

Jorge - It may be any change the the document state that triggers the problem. For example, doing nothing but calling the Select() method, or one of its variants, can change the document state (the Previous selection set is changed). -- http://www.caddzone.com AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 http://www.acadxtabs.com "Jorge Jimenez" wrote in message news:40a9816f$1_1@newsprd01... > Thanks for the reply Tony. > > Actually, the real dll does not change the layer at the > begincommand event, it stores a count of the entities > at the moment the command begins, and then compares > that count with the count at the endcommand event. > Then it changes the layer of the new entities. > The problems happens no matter how this is done. > > I agree with you about the cache factor, but the fact that > it only happens with certain values of the dimscale variable > makes this behavior quite different. > > I made this test dll as simple as possible to make sure > everyone could see the behavior without thinking it > could be some other event going on. > > I even took out the change layer code in the events, and > the problem persited. > > -- > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > (sorry, phony e-mail, SPAM made me do it) > > "Tony Tanzillo" wrote in message > news:40a979d4$1_3@newsprd01... > > Jorge - The fact that this happens is not something > > I would find shocking. > > > > Generally, making changes to the database in events > > like the ones you're using, can lead to unpredicable > > behavior. One reason why (but not necessarily the one > > that is causing this particular problem), is because > > many AutoCAD commands, especially older ones, locally > > cache things like the active layer and other relevant > > data used in the creation of new entities. So, in fact, > > changing the active layer after the fact, can actually > > be ignored by some commands because they may have > > already made a local copy of the value of the CLAYER > > system variable. > > > > Of course, it can depend on the mechanics of the > > command, and when the reactor/event is fired, but > > generally, doing the kind of things you're doing > > entails the risk of unpredicable behavior, on a > > command-specific basis. > > > > > > -- > > http://www.caddzone.com > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > http://www.acadxtabs.com > > > > > > "Jorge Jimenez" wrote in message > news:40a96ad2_2@newsprd01... > > > Can anyone confirm the following bug and where it's coming from ? > > > > > > 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a temp dir > > > 2. Regsvr32 DLLTest.dll > > > 3. Load AutoCAD 2000-2002 (it also happens with 2004 and 2005, just > change > > > the reference lib in the dll project and recompile) > > > 4. Select "Start from Scratch", "metric" > > > 5. Load the lisp "DLLtest.lsp" > > > 6. write DIMSCALE, and enter a value of 1.8 > > > 7. Use the DIMENSION menu and select LINEAR. Dim any two points > > > 8. Use the DIMENSION menu and select CONTINUE. Move the cursor and > watch > > > the dimcontinue command go bezerk !! > > > > > > Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the dimcontinue > > > works again !! > > > > > > The zip includes the source for the VB6 dlltest.dll > > > > > > TIA > > > -- > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > >
Message 7 of 14
Anonymous
in reply to: Anonymous

Thank for the reply. I have no doubt you are correct about that being a cause for many problems. But in this case, I'm not so sure about this. I have included the same DLL, but with the code for changing the layer commented out. So inside the begin and end command events there is ONLY a SELECT CASE which does NOTHING. So, if I'm not mistaken, of course, the document state should not change due to the select case statement. And still, AutoCAD presents the same weird behavior. -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica (sorry, phony e-mail, SPAM made me do it) "Tony Tanzillo" wrote in message news:40aa396a_3@newsprd01... > Jorge - It may be any change the the document state > that triggers the problem. For example, doing nothing > but calling the Select() method, or one of its variants, > can change the document state (the Previous selection > set is changed). > > > -- > http://www.caddzone.com > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > http://www.acadxtabs.com > > > "Jorge Jimenez" wrote in message news:40a9816f$1_1@newsprd01... > > Thanks for the reply Tony. > > > > Actually, the real dll does not change the layer at the > > begincommand event, it stores a count of the entities > > at the moment the command begins, and then compares > > that count with the count at the endcommand event. > > Then it changes the layer of the new entities. > > The problems happens no matter how this is done. > > > > I agree with you about the cache factor, but the fact that > > it only happens with certain values of the dimscale variable > > makes this behavior quite different. > > > > I made this test dll as simple as possible to make sure > > everyone could see the behavior without thinking it > > could be some other event going on. > > > > I even took out the change layer code in the events, and > > the problem persited. > > > > -- > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > (sorry, phony e-mail, SPAM made me do it) > > > > "Tony Tanzillo" wrote in message > > news:40a979d4$1_3@newsprd01... > > > Jorge - The fact that this happens is not something > > > I would find shocking. > > > > > > Generally, making changes to the database in events > > > like the ones you're using, can lead to unpredicable > > > behavior. One reason why (but not necessarily the one > > > that is causing this particular problem), is because > > > many AutoCAD commands, especially older ones, locally > > > cache things like the active layer and other relevant > > > data used in the creation of new entities. So, in fact, > > > changing the active layer after the fact, can actually > > > be ignored by some commands because they may have > > > already made a local copy of the value of the CLAYER > > > system variable. > > > > > > Of course, it can depend on the mechanics of the > > > command, and when the reactor/event is fired, but > > > generally, doing the kind of things you're doing > > > entails the risk of unpredicable behavior, on a > > > command-specific basis. > > > > > > > > > -- > > > http://www.caddzone.com > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > http://www.acadxtabs.com > > > > > > > > > "Jorge Jimenez" wrote in message > > news:40a96ad2_2@newsprd01... > > > > Can anyone confirm the following bug and where it's coming from ? > > > > > > > > 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a temp dir > > > > 2. Regsvr32 DLLTest.dll > > > > 3. Load AutoCAD 2000-2002 (it also happens with 2004 and 2005, just > > change > > > > the reference lib in the dll project and recompile) > > > > 4. Select "Start from Scratch", "metric" > > > > 5. Load the lisp "DLLtest.lsp" > > > > 6. write DIMSCALE, and enter a value of 1.8 > > > > 7. Use the DIMENSION menu and select LINEAR. Dim any two points > > > > 8. Use the DIMENSION menu and select CONTINUE. Move the cursor and > > watch > > > > the dimcontinue command go bezerk !! > > > > > > > > Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the dimcontinue > > > > works again !! > > > > > > > > The zip includes the source for the VB6 dlltest.dll > > > > > > > > TIA > > > > -- > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > > > > > > > > > > >
Message 8 of 14
Anonymous
in reply to: Anonymous

What happens if you comment out the Select Case statement entirely? -- http://www.caddzone.com AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 http://www.acadxtabs.com "Jorge Jimenez" wrote in message news:40aa405e_2@newsprd01... > Thank for the reply. > I have no doubt you are correct about that being a > cause for many problems. > > But in this case, I'm not so sure about this. > > I have included the same DLL, but with the code > for changing the layer commented out. > So inside the begin and end command events > there is ONLY a SELECT CASE which does > NOTHING. > > So, if I'm not mistaken, of course, the document state > should not change due to the select case statement. > > And still, AutoCAD presents the same weird behavior. > > -- > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > (sorry, phony e-mail, SPAM made me do it) > > "Tony Tanzillo" wrote in message > news:40aa396a_3@newsprd01... > > Jorge - It may be any change the the document state > > that triggers the problem. For example, doing nothing > > but calling the Select() method, or one of its variants, > > can change the document state (the Previous selection > > set is changed). > > > > > > -- > > http://www.caddzone.com > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > http://www.acadxtabs.com > > > > > > "Jorge Jimenez" wrote in message > news:40a9816f$1_1@newsprd01... > > > Thanks for the reply Tony. > > > > > > Actually, the real dll does not change the layer at the > > > begincommand event, it stores a count of the entities > > > at the moment the command begins, and then compares > > > that count with the count at the endcommand event. > > > Then it changes the layer of the new entities. > > > The problems happens no matter how this is done. > > > > > > I agree with you about the cache factor, but the fact that > > > it only happens with certain values of the dimscale variable > > > makes this behavior quite different. > > > > > > I made this test dll as simple as possible to make sure > > > everyone could see the behavior without thinking it > > > could be some other event going on. > > > > > > I even took out the change layer code in the events, and > > > the problem persited. > > > > > > -- > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > "Tony Tanzillo" wrote in message > > > news:40a979d4$1_3@newsprd01... > > > > Jorge - The fact that this happens is not something > > > > I would find shocking. > > > > > > > > Generally, making changes to the database in events > > > > like the ones you're using, can lead to unpredicable > > > > behavior. One reason why (but not necessarily the one > > > > that is causing this particular problem), is because > > > > many AutoCAD commands, especially older ones, locally > > > > cache things like the active layer and other relevant > > > > data used in the creation of new entities. So, in fact, > > > > changing the active layer after the fact, can actually > > > > be ignored by some commands because they may have > > > > already made a local copy of the value of the CLAYER > > > > system variable. > > > > > > > > Of course, it can depend on the mechanics of the > > > > command, and when the reactor/event is fired, but > > > > generally, doing the kind of things you're doing > > > > entails the risk of unpredicable behavior, on a > > > > command-specific basis. > > > > > > > > > > > > -- > > > > http://www.caddzone.com > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > http://www.acadxtabs.com > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > news:40a96ad2_2@newsprd01... > > > > > Can anyone confirm the following bug and where it's coming from ? > > > > > > > > > > 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a temp dir > > > > > 2. Regsvr32 DLLTest.dll > > > > > 3. Load AutoCAD 2000-2002 (it also happens with 2004 and 2005, just > > > change > > > > > the reference lib in the dll project and recompile) > > > > > 4. Select "Start from Scratch", "metric" > > > > > 5. Load the lisp "DLLtest.lsp" > > > > > 6. write DIMSCALE, and enter a value of 1.8 > > > > > 7. Use the DIMENSION menu and select LINEAR. Dim any two points > > > > > 8. Use the DIMENSION menu and select CONTINUE. Move the cursor and > > > watch > > > > > the dimcontinue command go bezerk !! > > > > > > > > > > Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the > dimcontinue > > > > > works again !! > > > > > > > > > > The zip includes the source for the VB6 dlltest.dll > > > > > > > > > > TIA > > > > > -- > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Message 9 of 14
Anonymous
in reply to: Anonymous

I commented out the Select Case statement entirely and the wierd DIMCONTINUE behavior IS STILL HAPPENING !! There is no code in the begin and end command events except a dim. Now this is very strange indeed.!! -- Saludos, Ing. Jorge Jimenez SICAD S.A., Costa Rica "Tony Tanzillo" wrote in message news:40aa4eb6_3@newsprd01... > What happens if you comment out the Select Case > statement entirely? > > -- > http://www.caddzone.com > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > http://www.acadxtabs.com > > > "Jorge Jimenez" wrote in message news:40aa405e_2@newsprd01... > > Thank for the reply. > > I have no doubt you are correct about that being a > > cause for many problems. > > > > But in this case, I'm not so sure about this. > > > > I have included the same DLL, but with the code > > for changing the layer commented out. > > So inside the begin and end command events > > there is ONLY a SELECT CASE which does > > NOTHING. > > > > So, if I'm not mistaken, of course, the document state > > should not change due to the select case statement. > > > > And still, AutoCAD presents the same weird behavior. > > > > -- > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > (sorry, phony e-mail, SPAM made me do it) > > > > "Tony Tanzillo" wrote in message > > news:40aa396a_3@newsprd01... > > > Jorge - It may be any change the the document state > > > that triggers the problem. For example, doing nothing > > > but calling the Select() method, or one of its variants, > > > can change the document state (the Previous selection > > > set is changed). > > > > > > > > > -- > > > http://www.caddzone.com > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > http://www.acadxtabs.com > > > > > > > > > "Jorge Jimenez" wrote in message > > news:40a9816f$1_1@newsprd01... > > > > Thanks for the reply Tony. > > > > > > > > Actually, the real dll does not change the layer at the > > > > begincommand event, it stores a count of the entities > > > > at the moment the command begins, and then compares > > > > that count with the count at the endcommand event. > > > > Then it changes the layer of the new entities. > > > > The problems happens no matter how this is done. > > > > > > > > I agree with you about the cache factor, but the fact that > > > > it only happens with certain values of the dimscale variable > > > > makes this behavior quite different. > > > > > > > > I made this test dll as simple as possible to make sure > > > > everyone could see the behavior without thinking it > > > > could be some other event going on. > > > > > > > > I even took out the change layer code in the events, and > > > > the problem persited. > > > > > > > > -- > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > "Tony Tanzillo" wrote in message > > > > news:40a979d4$1_3@newsprd01... > > > > > Jorge - The fact that this happens is not something > > > > > I would find shocking. > > > > > > > > > > Generally, making changes to the database in events > > > > > like the ones you're using, can lead to unpredicable > > > > > behavior. One reason why (but not necessarily the one > > > > > that is causing this particular problem), is because > > > > > many AutoCAD commands, especially older ones, locally > > > > > cache things like the active layer and other relevant > > > > > data used in the creation of new entities. So, in fact, > > > > > changing the active layer after the fact, can actually > > > > > be ignored by some commands because they may have > > > > > already made a local copy of the value of the CLAYER > > > > > system variable. > > > > > > > > > > Of course, it can depend on the mechanics of the > > > > > command, and when the reactor/event is fired, but > > > > > generally, doing the kind of things you're doing > > > > > entails the risk of unpredicable behavior, on a > > > > > command-specific basis. > > > > > > > > > > > > > > > -- > > > > > http://www.caddzone.com > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > news:40a96ad2_2@newsprd01... > > > > > > Can anyone confirm the following bug and where it's coming from ? > > > > > > > > > > > > 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a temp dir > > > > > > 2. Regsvr32 DLLTest.dll > > > > > > 3. Load AutoCAD 2000-2002 (it also happens with 2004 and 2005, just > > > > change > > > > > > the reference lib in the dll project and recompile) > > > > > > 4. Select "Start from Scratch", "metric" > > > > > > 5. Load the lisp "DLLtest.lsp" > > > > > > 6. write DIMSCALE, and enter a value of 1.8 > > > > > > 7. Use the DIMENSION menu and select LINEAR. Dim any two points > > > > > > 8. Use the DIMENSION menu and select CONTINUE. Move the cursor and > > > > watch > > > > > > the dimcontinue command go bezerk !! > > > > > > > > > > > > Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the > > dimcontinue > > > > > > works again !! > > > > > > > > > > > > The zip includes the source for the VB6 dlltest.dll > > > > > > > > > > > > TIA > > > > > > -- > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Message 10 of 14
Anonymous
in reply to: Anonymous

My next suggestion is to try using the Document's BeginCommand and EndCommand events, rather than the Application's -- http://www.caddzone.com AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 http://www.acadxtabs.com "Jorge Jimenez" wrote in message news:40aa5790$1_2@newsprd01... > I commented out the Select Case statement entirely > and the wierd DIMCONTINUE behavior IS STILL HAPPENING !! > > There is no code in the begin and end command events > except a dim. > > Now this is very strange indeed.!! > > -- > Saludos, > Ing. Jorge Jimenez > SICAD S.A., Costa Rica > > "Tony Tanzillo" wrote in message > news:40aa4eb6_3@newsprd01... > > What happens if you comment out the Select Case > > statement entirely? > > > > -- > > http://www.caddzone.com > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > http://www.acadxtabs.com > > > > > > "Jorge Jimenez" wrote in message > news:40aa405e_2@newsprd01... > > > Thank for the reply. > > > I have no doubt you are correct about that being a > > > cause for many problems. > > > > > > But in this case, I'm not so sure about this. > > > > > > I have included the same DLL, but with the code > > > for changing the layer commented out. > > > So inside the begin and end command events > > > there is ONLY a SELECT CASE which does > > > NOTHING. > > > > > > So, if I'm not mistaken, of course, the document state > > > should not change due to the select case statement. > > > > > > And still, AutoCAD presents the same weird behavior. > > > > > > -- > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > "Tony Tanzillo" wrote in message > > > news:40aa396a_3@newsprd01... > > > > Jorge - It may be any change the the document state > > > > that triggers the problem. For example, doing nothing > > > > but calling the Select() method, or one of its variants, > > > > can change the document state (the Previous selection > > > > set is changed). > > > > > > > > > > > > -- > > > > http://www.caddzone.com > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > http://www.acadxtabs.com > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > news:40a9816f$1_1@newsprd01... > > > > > Thanks for the reply Tony. > > > > > > > > > > Actually, the real dll does not change the layer at the > > > > > begincommand event, it stores a count of the entities > > > > > at the moment the command begins, and then compares > > > > > that count with the count at the endcommand event. > > > > > Then it changes the layer of the new entities. > > > > > The problems happens no matter how this is done. > > > > > > > > > > I agree with you about the cache factor, but the fact that > > > > > it only happens with certain values of the dimscale variable > > > > > makes this behavior quite different. > > > > > > > > > > I made this test dll as simple as possible to make sure > > > > > everyone could see the behavior without thinking it > > > > > could be some other event going on. > > > > > > > > > > I even took out the change layer code in the events, and > > > > > the problem persited. > > > > > > > > > > -- > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > "Tony Tanzillo" wrote in message > > > > > news:40a979d4$1_3@newsprd01... > > > > > > Jorge - The fact that this happens is not something > > > > > > I would find shocking. > > > > > > > > > > > > Generally, making changes to the database in events > > > > > > like the ones you're using, can lead to unpredicable > > > > > > behavior. One reason why (but not necessarily the one > > > > > > that is causing this particular problem), is because > > > > > > many AutoCAD commands, especially older ones, locally > > > > > > cache things like the active layer and other relevant > > > > > > data used in the creation of new entities. So, in fact, > > > > > > changing the active layer after the fact, can actually > > > > > > be ignored by some commands because they may have > > > > > > already made a local copy of the value of the CLAYER > > > > > > system variable. > > > > > > > > > > > > Of course, it can depend on the mechanics of the > > > > > > command, and when the reactor/event is fired, but > > > > > > generally, doing the kind of things you're doing > > > > > > entails the risk of unpredicable behavior, on a > > > > > > command-specific basis. > > > > > > > > > > > > > > > > > > -- > > > > > > http://www.caddzone.com > > > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > > news:40a96ad2_2@newsprd01... > > > > > > > Can anyone confirm the following bug and where it's coming from > ? > > > > > > > > > > > > > > 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a temp > dir > > > > > > > 2. Regsvr32 DLLTest.dll > > > > > > > 3. Load AutoCAD 2000-2002 (it also happens with 2004 and 2005, > just > > > > > change > > > > > > > the reference lib in the dll project and recompile) > > > > > > > 4. Select "Start from Scratch", "metric" > > > > > > > 5. Load the lisp "DLLtest.lsp" > > > > > > > 6. write DIMSCALE, and enter a value of 1.8 > > > > > > > 7. Use the DIMENSION menu and select LINEAR. Dim any two points > > > > > > > 8. Use the DIMENSION menu and select CONTINUE. Move the cursor > and > > > > > watch > > > > > > > the dimcontinue command go bezerk !! > > > > > > > > > > > > > > Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the > > > dimcontinue > > > > > > > works again !! > > > > > > > > > > > > > > The zip includes the source for the VB6 dlltest.dll > > > > > > > > > > > > > > TIA > > > > > > > -- > > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Message 11 of 14
Anonymous
in reply to: Anonymous

Thanks alot for the suggestion, but it didn't work. DIMCONTINUE with a DIMSCALE value of 1.8 still goes bezerk !! This is what I did: 1. Dimension the acad application variable Acapp without events 2. Dimension the Adoc variable as autocad.acaddocument WITH events 3. Place the change layer code to the Begin and End command events of the Adoc This is the class as I have it now: VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "Comandos" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True 'Public WithEvents Acapp As AutoCAD.AcadApplication Public acapp As AutoCAD.AcadApplication Public WithEvents Adoc As AutoCAD.AcadDocument Attribute Adoc.VB_VarHelpID = -1 Public Function Iniciar(tAcadapp As AutoCAD.AcadApplication) As Long Dim myform As Form Set acapp = tAcadapp Set Adoc = acapp.ActiveDocument dimlayer = "DimLayer" dimcolor = 1 End Function Private Sub Adoc_BeginCommand(ByVal CommandName As String) Dim mylayer As AutoCAD.AcadLayer Select Case CommandName Case "DIMLINEAR", "DIMALIGNED", "DIMORDINATE", "DIMRADIUS", "DIMDIAMETER", "DIMANGULAR", "DIMBASELINE", "DIMCONTINUE", "QLEADER", "LEADER" Set Tactivelayer = acapp.ActiveDocument.ActiveLayer Set mylayer = acapp.ActiveDocument.Layers.Add(dimlayer) mylayer.Color = dimcolor mylayer.Lock = False mylayer.Freeze = False mylayer.LayerOn = True acapp.ActiveDocument.ActiveLayer = mylayer End Select End Sub Private Sub Adoc_EndCommand(ByVal CommandName As String) Dim temp As String Select Case CommandName Case "DIMLINEAR", "DIMALIGNED", "DIMORDINATE", "DIMRADIUS", "DIMDIAMETER", "DIMANGULAR", "DIMBASELINE", "DIMCONTINUE", "QLEADER", "LEADER" acapp.ActiveDocument.ActiveLayer = Tactivelayer End Select End Sub -- Saludos, Ing. Jorge Jimenez SICAD S.A., Costa Rica "Tony Tanzillo" wrote in message news:40aa5d17$1_3@newsprd01... > My next suggestion is to try using the Document's > BeginCommand and EndCommand events, rather than > the Application's > > -- > http://www.caddzone.com > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > http://www.acadxtabs.com > > > "Jorge Jimenez" wrote in message news:40aa5790$1_2@newsprd01... > > I commented out the Select Case statement entirely > > and the wierd DIMCONTINUE behavior IS STILL HAPPENING !! > > > > There is no code in the begin and end command events > > except a dim. > > > > Now this is very strange indeed.!! > > > > -- > > Saludos, > > Ing. Jorge Jimenez > > SICAD S.A., Costa Rica > > > > "Tony Tanzillo" wrote in message > > news:40aa4eb6_3@newsprd01... > > > What happens if you comment out the Select Case > > > statement entirely? > > > > > > -- > > > http://www.caddzone.com > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > http://www.acadxtabs.com > > > > > > > > > "Jorge Jimenez" wrote in message > > news:40aa405e_2@newsprd01... > > > > Thank for the reply. > > > > I have no doubt you are correct about that being a > > > > cause for many problems. > > > > > > > > But in this case, I'm not so sure about this. > > > > > > > > I have included the same DLL, but with the code > > > > for changing the layer commented out. > > > > So inside the begin and end command events > > > > there is ONLY a SELECT CASE which does > > > > NOTHING. > > > > > > > > So, if I'm not mistaken, of course, the document state > > > > should not change due to the select case statement. > > > > > > > > And still, AutoCAD presents the same weird behavior. > > > > > > > > -- > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > "Tony Tanzillo" wrote in message > > > > news:40aa396a_3@newsprd01... > > > > > Jorge - It may be any change the the document state > > > > > that triggers the problem. For example, doing nothing > > > > > but calling the Select() method, or one of its variants, > > > > > can change the document state (the Previous selection > > > > > set is changed). > > > > > > > > > > > > > > > -- > > > > > http://www.caddzone.com > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > news:40a9816f$1_1@newsprd01... > > > > > > Thanks for the reply Tony. > > > > > > > > > > > > Actually, the real dll does not change the layer at the > > > > > > begincommand event, it stores a count of the entities > > > > > > at the moment the command begins, and then compares > > > > > > that count with the count at the endcommand event. > > > > > > Then it changes the layer of the new entities. > > > > > > The problems happens no matter how this is done. > > > > > > > > > > > > I agree with you about the cache factor, but the fact that > > > > > > it only happens with certain values of the dimscale variable > > > > > > makes this behavior quite different. > > > > > > > > > > > > I made this test dll as simple as possible to make sure > > > > > > everyone could see the behavior without thinking it > > > > > > could be some other event going on. > > > > > > > > > > > > I even took out the change layer code in the events, and > > > > > > the problem persited. > > > > > > > > > > > > -- > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > "Tony Tanzillo" wrote in message > > > > > > news:40a979d4$1_3@newsprd01... > > > > > > > Jorge - The fact that this happens is not something > > > > > > > I would find shocking. > > > > > > > > > > > > > > Generally, making changes to the database in events > > > > > > > like the ones you're using, can lead to unpredicable > > > > > > > behavior. One reason why (but not necessarily the one > > > > > > > that is causing this particular problem), is because > > > > > > > many AutoCAD commands, especially older ones, locally > > > > > > > cache things like the active layer and other relevant > > > > > > > data used in the creation of new entities. So, in fact, > > > > > > > changing the active layer after the fact, can actually > > > > > > > be ignored by some commands because they may have > > > > > > > already made a local copy of the value of the CLAYER > > > > > > > system variable. > > > > > > > > > > > > > > Of course, it can depend on the mechanics of the > > > > > > > command, and when the reactor/event is fired, but > > > > > > > generally, doing the kind of things you're doing > > > > > > > entails the risk of unpredicable behavior, on a > > > > > > > command-specific basis. > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > http://www.caddzone.com > > > > > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > > > news:40a96ad2_2@newsprd01... > > > > > > > > Can anyone confirm the following bug and where it's coming from > > ? > > > > > > > > > > > > > > > > 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a temp > > dir > > > > > > > > 2. Regsvr32 DLLTest.dll > > > > > > > > 3. Load AutoCAD 2000-2002 (it also happens with 2004 and 2005, > > just > > > > > > change > > > > > > > > the reference lib in the dll project and recompile) > > > > > > > > 4. Select "Start from Scratch", "metric" > > > > > > > > 5. Load the lisp "DLLtest.lsp" > > > > > > > > 6. write DIMSCALE, and enter a value of 1.8 > > > > > > > > 7. Use the DIMENSION menu and select LINEAR. Dim any two points > > > > > > > > 8. Use the DIMENSION menu and select CONTINUE. Move the cursor > > and > > > > > > watch > > > > > > > > the dimcontinue command go bezerk !! > > > > > > > > > > > > > > > > Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the > > > > dimcontinue > > > > > > > > works again !! > > > > > > > > > > > > > > > > The zip includes the source for the VB6 dlltest.dll > > > > > > > > > > > > > > > > TIA > > > > > > > > -- > > > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Message 12 of 14
Anonymous
in reply to: Anonymous

Ignoring this problem for a moment, and with all the normal code you're using in the Begin/EndCommand events, have you tested this with AutoCAD 2004, and verified that it does not affect the user's ability to use UNDO/REDO without restriction? -- http://www.caddzone.com AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 http://www.acadxtabs.com "Jorge Jimenez" wrote in message news:40aa7244_1@newsprd01... > Thanks alot for the suggestion, but it didn't work. > DIMCONTINUE with a DIMSCALE value of 1.8 still goes bezerk !! > > This is what I did: > 1. Dimension the acad application variable Acapp without events > 2. Dimension the Adoc variable as autocad.acaddocument WITH events > 3. Place the change layer code to the Begin and End command events of the > Adoc > > This is the class as I have it now: > > VERSION 1.0 CLASS > BEGIN > MultiUse = -1 'True > Persistable = 0 'NotPersistable > DataBindingBehavior = 0 'vbNone > DataSourceBehavior = 0 'vbNone > MTSTransactionMode = 0 'NotAnMTSObject > END > Attribute VB_Name = "Comandos" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > > 'Public WithEvents Acapp As AutoCAD.AcadApplication > Public acapp As AutoCAD.AcadApplication > Public WithEvents Adoc As AutoCAD.AcadDocument > Attribute Adoc.VB_VarHelpID = -1 > > Public Function Iniciar(tAcadapp As AutoCAD.AcadApplication) As Long > > Dim myform As Form > Set acapp = tAcadapp > Set Adoc = acapp.ActiveDocument > dimlayer = "DimLayer" > dimcolor = 1 > End Function > > Private Sub Adoc_BeginCommand(ByVal CommandName As String) > Dim mylayer As AutoCAD.AcadLayer > Select Case CommandName > Case "DIMLINEAR", "DIMALIGNED", "DIMORDINATE", "DIMRADIUS", > "DIMDIAMETER", "DIMANGULAR", "DIMBASELINE", "DIMCONTINUE", "QLEADER", > "LEADER" > Set Tactivelayer = acapp.ActiveDocument.ActiveLayer > > Set mylayer = acapp.ActiveDocument.Layers.Add(dimlayer) > mylayer.Color = dimcolor > mylayer.Lock = False > mylayer.Freeze = False > mylayer.LayerOn = True > acapp.ActiveDocument.ActiveLayer = mylayer > > > End Select > End Sub > > Private Sub Adoc_EndCommand(ByVal CommandName As String) > Dim temp As String > Select Case CommandName > Case "DIMLINEAR", "DIMALIGNED", "DIMORDINATE", "DIMRADIUS", > "DIMDIAMETER", "DIMANGULAR", "DIMBASELINE", "DIMCONTINUE", "QLEADER", > "LEADER" > acapp.ActiveDocument.ActiveLayer = Tactivelayer > > End Select > End Sub > > > > -- > Saludos, > Ing. Jorge Jimenez > SICAD S.A., Costa Rica > > > "Tony Tanzillo" wrote in message > news:40aa5d17$1_3@newsprd01... > > My next suggestion is to try using the Document's > > BeginCommand and EndCommand events, rather than > > the Application's > > > > -- > > http://www.caddzone.com > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > http://www.acadxtabs.com > > > > > > "Jorge Jimenez" wrote in message > news:40aa5790$1_2@newsprd01... > > > I commented out the Select Case statement entirely > > > and the wierd DIMCONTINUE behavior IS STILL HAPPENING !! > > > > > > There is no code in the begin and end command events > > > except a dim. > > > > > > Now this is very strange indeed.!! > > > > > > -- > > > Saludos, > > > Ing. Jorge Jimenez > > > SICAD S.A., Costa Rica > > > > > > "Tony Tanzillo" wrote in message > > > news:40aa4eb6_3@newsprd01... > > > > What happens if you comment out the Select Case > > > > statement entirely? > > > > > > > > -- > > > > http://www.caddzone.com > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > http://www.acadxtabs.com > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > news:40aa405e_2@newsprd01... > > > > > Thank for the reply. > > > > > I have no doubt you are correct about that being a > > > > > cause for many problems. > > > > > > > > > > But in this case, I'm not so sure about this. > > > > > > > > > > I have included the same DLL, but with the code > > > > > for changing the layer commented out. > > > > > So inside the begin and end command events > > > > > there is ONLY a SELECT CASE which does > > > > > NOTHING. > > > > > > > > > > So, if I'm not mistaken, of course, the document state > > > > > should not change due to the select case statement. > > > > > > > > > > And still, AutoCAD presents the same weird behavior. > > > > > > > > > > -- > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > "Tony Tanzillo" wrote in message > > > > > news:40aa396a_3@newsprd01... > > > > > > Jorge - It may be any change the the document state > > > > > > that triggers the problem. For example, doing nothing > > > > > > but calling the Select() method, or one of its variants, > > > > > > can change the document state (the Previous selection > > > > > > set is changed). > > > > > > > > > > > > > > > > > > -- > > > > > > http://www.caddzone.com > > > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > > news:40a9816f$1_1@newsprd01... > > > > > > > Thanks for the reply Tony. > > > > > > > > > > > > > > Actually, the real dll does not change the layer at the > > > > > > > begincommand event, it stores a count of the entities > > > > > > > at the moment the command begins, and then compares > > > > > > > that count with the count at the endcommand event. > > > > > > > Then it changes the layer of the new entities. > > > > > > > The problems happens no matter how this is done. > > > > > > > > > > > > > > I agree with you about the cache factor, but the fact that > > > > > > > it only happens with certain values of the dimscale variable > > > > > > > makes this behavior quite different. > > > > > > > > > > > > > > I made this test dll as simple as possible to make sure > > > > > > > everyone could see the behavior without thinking it > > > > > > > could be some other event going on. > > > > > > > > > > > > > > I even took out the change layer code in the events, and > > > > > > > the problem persited. > > > > > > > > > > > > > > -- > > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > "Tony Tanzillo" wrote in message > > > > > > > news:40a979d4$1_3@newsprd01... > > > > > > > > Jorge - The fact that this happens is not something > > > > > > > > I would find shocking. > > > > > > > > > > > > > > > > Generally, making changes to the database in events > > > > > > > > like the ones you're using, can lead to unpredicable > > > > > > > > behavior. One reason why (but not necessarily the one > > > > > > > > that is causing this particular problem), is because > > > > > > > > many AutoCAD commands, especially older ones, locally > > > > > > > > cache things like the active layer and other relevant > > > > > > > > data used in the creation of new entities. So, in fact, > > > > > > > > changing the active layer after the fact, can actually > > > > > > > > be ignored by some commands because they may have > > > > > > > > already made a local copy of the value of the CLAYER > > > > > > > > system variable. > > > > > > > > > > > > > > > > Of course, it can depend on the mechanics of the > > > > > > > > command, and when the reactor/event is fired, but > > > > > > > > generally, doing the kind of things you're doing > > > > > > > > entails the risk of unpredicable behavior, on a > > > > > > > > command-specific basis. > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > http://www.caddzone.com > > > > > > > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > > > > news:40a96ad2_2@newsprd01... > > > > > > > > > Can anyone confirm the following bug and where it's coming > from > > > ? > > > > > > > > > > > > > > > > > > 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a > temp > > > dir > > > > > > > > > 2. Regsvr32 DLLTest.dll > > > > > > > > > 3. Load AutoCAD 2000-2002 (it also happens with 2004 and > 2005, > > > just > > > > > > > change > > > > > > > > > the reference lib in the dll project and recompile) > > > > > > > > > 4. Select "Start from Scratch", "metric" > > > > > > > > > 5. Load the lisp "DLLtest.lsp" > > > > > > > > > 6. write DIMSCALE, and enter a value of 1.8 > > > > > > > > > 7. Use the DIMENSION menu and select LINEAR. Dim any two > points > > > > > > > > > 8. Use the DIMENSION menu and select CONTINUE. Move the > cursor > > > and > > > > > > > watch > > > > > > > > > the dimcontinue command go bezerk !! > > > > > > > > > > > > > > > > > > Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the > > > > > dimcontinue > > > > > > > > > works again !! > > > > > > > > > > > > > > > > > > The zip includes the source for the VB6 dlltest.dll > > > > > > > > > > > > > > > > > > TIA > > > > > > > > > -- > > > > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Message 13 of 14
Anonymous
in reply to: Anonymous

Well, I tested it in AutoCAD 2004, and had exactly the same results !! I then drew some lines, circles, ellipses, hatches, and tested the undo/redo many times, without any problem whatsoever. I checked that the dimscale value was still 1.8 I then dimension linear and then dimcontinue and IT WORKED !!! What the heck is happening here ??? -- Saludos, Ing. Jorge Jimenez SICAD S.A., Costa Rica "Tony Tanzillo" wrote in message news:40aa7457_1@newsprd01... > Ignoring this problem for a moment, and with all > the normal code you're using in the Begin/EndCommand > events, have you tested this with AutoCAD 2004, and > verified that it does not affect the user's ability > to use UNDO/REDO without restriction? > > -- > http://www.caddzone.com > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > http://www.acadxtabs.com > > > "Jorge Jimenez" wrote in message news:40aa7244_1@newsprd01... > > Thanks alot for the suggestion, but it didn't work. > > DIMCONTINUE with a DIMSCALE value of 1.8 still goes bezerk !! > > > > This is what I did: > > 1. Dimension the acad application variable Acapp without events > > 2. Dimension the Adoc variable as autocad.acaddocument WITH events > > 3. Place the change layer code to the Begin and End command events of the > > Adoc > > > > This is the class as I have it now: > > > > VERSION 1.0 CLASS > > BEGIN > > MultiUse = -1 'True > > Persistable = 0 'NotPersistable > > DataBindingBehavior = 0 'vbNone > > DataSourceBehavior = 0 'vbNone > > MTSTransactionMode = 0 'NotAnMTSObject > > END > > Attribute VB_Name = "Comandos" > > Attribute VB_GlobalNameSpace = False > > Attribute VB_Creatable = True > > Attribute VB_PredeclaredId = False > > Attribute VB_Exposed = True > > > > 'Public WithEvents Acapp As AutoCAD.AcadApplication > > Public acapp As AutoCAD.AcadApplication > > Public WithEvents Adoc As AutoCAD.AcadDocument > > Attribute Adoc.VB_VarHelpID = -1 > > > > Public Function Iniciar(tAcadapp As AutoCAD.AcadApplication) As Long > > > > Dim myform As Form > > Set acapp = tAcadapp > > Set Adoc = acapp.ActiveDocument > > dimlayer = "DimLayer" > > dimcolor = 1 > > End Function > > > > Private Sub Adoc_BeginCommand(ByVal CommandName As String) > > Dim mylayer As AutoCAD.AcadLayer > > Select Case CommandName > > Case "DIMLINEAR", "DIMALIGNED", "DIMORDINATE", "DIMRADIUS", > > "DIMDIAMETER", "DIMANGULAR", "DIMBASELINE", "DIMCONTINUE", "QLEADER", > > "LEADER" > > Set Tactivelayer = acapp.ActiveDocument.ActiveLayer > > > > Set mylayer = acapp.ActiveDocument.Layers.Add(dimlayer) > > mylayer.Color = dimcolor > > mylayer.Lock = False > > mylayer.Freeze = False > > mylayer.LayerOn = True > > acapp.ActiveDocument.ActiveLayer = mylayer > > > > > > End Select > > End Sub > > > > Private Sub Adoc_EndCommand(ByVal CommandName As String) > > Dim temp As String > > Select Case CommandName > > Case "DIMLINEAR", "DIMALIGNED", "DIMORDINATE", "DIMRADIUS", > > "DIMDIAMETER", "DIMANGULAR", "DIMBASELINE", "DIMCONTINUE", "QLEADER", > > "LEADER" > > acapp.ActiveDocument.ActiveLayer = Tactivelayer > > > > End Select > > End Sub > > > > > > > > -- > > Saludos, > > Ing. Jorge Jimenez > > SICAD S.A., Costa Rica > > > > > > "Tony Tanzillo" wrote in message > > news:40aa5d17$1_3@newsprd01... > > > My next suggestion is to try using the Document's > > > BeginCommand and EndCommand events, rather than > > > the Application's > > > > > > -- > > > http://www.caddzone.com > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > http://www.acadxtabs.com > > > > > > > > > "Jorge Jimenez" wrote in message > > news:40aa5790$1_2@newsprd01... > > > > I commented out the Select Case statement entirely > > > > and the wierd DIMCONTINUE behavior IS STILL HAPPENING !! > > > > > > > > There is no code in the begin and end command events > > > > except a dim. > > > > > > > > Now this is very strange indeed.!! > > > > > > > > -- > > > > Saludos, > > > > Ing. Jorge Jimenez > > > > SICAD S.A., Costa Rica > > > > > > > > "Tony Tanzillo" wrote in message > > > > news:40aa4eb6_3@newsprd01... > > > > > What happens if you comment out the Select Case > > > > > statement entirely? > > > > > > > > > > -- > > > > > http://www.caddzone.com > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > news:40aa405e_2@newsprd01... > > > > > > Thank for the reply. > > > > > > I have no doubt you are correct about that being a > > > > > > cause for many problems. > > > > > > > > > > > > But in this case, I'm not so sure about this. > > > > > > > > > > > > I have included the same DLL, but with the code > > > > > > for changing the layer commented out. > > > > > > So inside the begin and end command events > > > > > > there is ONLY a SELECT CASE which does > > > > > > NOTHING. > > > > > > > > > > > > So, if I'm not mistaken, of course, the document state > > > > > > should not change due to the select case statement. > > > > > > > > > > > > And still, AutoCAD presents the same weird behavior. > > > > > > > > > > > > -- > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > "Tony Tanzillo" wrote in message > > > > > > news:40aa396a_3@newsprd01... > > > > > > > Jorge - It may be any change the the document state > > > > > > > that triggers the problem. For example, doing nothing > > > > > > > but calling the Select() method, or one of its variants, > > > > > > > can change the document state (the Previous selection > > > > > > > set is changed). > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > http://www.caddzone.com > > > > > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > > > news:40a9816f$1_1@newsprd01... > > > > > > > > Thanks for the reply Tony. > > > > > > > > > > > > > > > > Actually, the real dll does not change the layer at the > > > > > > > > begincommand event, it stores a count of the entities > > > > > > > > at the moment the command begins, and then compares > > > > > > > > that count with the count at the endcommand event. > > > > > > > > Then it changes the layer of the new entities. > > > > > > > > The problems happens no matter how this is done. > > > > > > > > > > > > > > > > I agree with you about the cache factor, but the fact that > > > > > > > > it only happens with certain values of the dimscale variable > > > > > > > > makes this behavior quite different. > > > > > > > > > > > > > > > > I made this test dll as simple as possible to make sure > > > > > > > > everyone could see the behavior without thinking it > > > > > > > > could be some other event going on. > > > > > > > > > > > > > > > > I even took out the change layer code in the events, and > > > > > > > > the problem persited. > > > > > > > > > > > > > > > > -- > > > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > > > "Tony Tanzillo" wrote in message > > > > > > > > news:40a979d4$1_3@newsprd01... > > > > > > > > > Jorge - The fact that this happens is not something > > > > > > > > > I would find shocking. > > > > > > > > > > > > > > > > > > Generally, making changes to the database in events > > > > > > > > > like the ones you're using, can lead to unpredicable > > > > > > > > > behavior. One reason why (but not necessarily the one > > > > > > > > > that is causing this particular problem), is because > > > > > > > > > many AutoCAD commands, especially older ones, locally > > > > > > > > > cache things like the active layer and other relevant > > > > > > > > > data used in the creation of new entities. So, in fact, > > > > > > > > > changing the active layer after the fact, can actually > > > > > > > > > be ignored by some commands because they may have > > > > > > > > > already made a local copy of the value of the CLAYER > > > > > > > > > system variable. > > > > > > > > > > > > > > > > > > Of course, it can depend on the mechanics of the > > > > > > > > > command, and when the reactor/event is fired, but > > > > > > > > > generally, doing the kind of things you're doing > > > > > > > > > entails the risk of unpredicable behavior, on a > > > > > > > > > command-specific basis. > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > http://www.caddzone.com > > > > > > > > > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > > > > > news:40a96ad2_2@newsprd01... > > > > > > > > > > Can anyone confirm the following bug and where it's coming > > from > > > > ? > > > > > > > > > > > > > > > > > > > > 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a > > temp > > > > dir > > > > > > > > > > 2. Regsvr32 DLLTest.dll > > > > > > > > > > 3. Load AutoCAD 2000-2002 (it also happens with 2004 and > > 2005, > > > > just > > > > > > > > change > > > > > > > > > > the reference lib in the dll project and recompile) > > > > > > > > > > 4. Select "Start from Scratch", "metric" > > > > > > > > > > 5. Load the lisp "DLLtest.lsp" > > > > > > > > > > 6. write DIMSCALE, and enter a value of 1.8 > > > > > > > > > > 7. Use the DIMENSION menu and select LINEAR. Dim any two > > points > > > > > > > > > > 8. Use the DIMENSION menu and select CONTINUE. Move the > > cursor > > > > and > > > > > > > > watch > > > > > > > > > > the dimcontinue command go bezerk !! > > > > > > > > > > > > > > > > > > > > Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the > > > > > > dimcontinue > > > > > > > > > > works again !! > > > > > > > > > > > > > > > > > > > > The zip includes the source for the VB6 dlltest.dll > > > > > > > > > > > > > > > > > > > > TIA > > > > > > > > > > -- > > > > > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Message 14 of 14
Anonymous
in reply to: Anonymous

Here is un update. I start ACAD 2004, metric drawing Load dlltest.lsp dimscale =1.8 I then do a dimlinear of any two points on the screen. This is placed in dimlayer (color red) by the dll I then do a dimcontinue, at this moment the command goes crazy. I draw a rectangle I hatch the rectangle I undo both. At this moment, the linear dimension, which is in the dimlayer (color red) turns white !!! (I have a black background) I click on the dimension and check the layer pulldown and it shows that this dimension is still in the dimlayer But the dimension has lost it's color !!! I then Regen the drawing, and the dimension turns red again !!! ?????? -- Saludos, Ing. Jorge Jimenez SICAD S.A., Costa Rica "Tony Tanzillo" wrote in message news:40aa7457_1@newsprd01... > Ignoring this problem for a moment, and with all > the normal code you're using in the Begin/EndCommand > events, have you tested this with AutoCAD 2004, and > verified that it does not affect the user's ability > to use UNDO/REDO without restriction? > > -- > http://www.caddzone.com > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > http://www.acadxtabs.com > > > "Jorge Jimenez" wrote in message news:40aa7244_1@newsprd01... > > Thanks alot for the suggestion, but it didn't work. > > DIMCONTINUE with a DIMSCALE value of 1.8 still goes bezerk !! > > > > This is what I did: > > 1. Dimension the acad application variable Acapp without events > > 2. Dimension the Adoc variable as autocad.acaddocument WITH events > > 3. Place the change layer code to the Begin and End command events of the > > Adoc > > > > This is the class as I have it now: > > > > VERSION 1.0 CLASS > > BEGIN > > MultiUse = -1 'True > > Persistable = 0 'NotPersistable > > DataBindingBehavior = 0 'vbNone > > DataSourceBehavior = 0 'vbNone > > MTSTransactionMode = 0 'NotAnMTSObject > > END > > Attribute VB_Name = "Comandos" > > Attribute VB_GlobalNameSpace = False > > Attribute VB_Creatable = True > > Attribute VB_PredeclaredId = False > > Attribute VB_Exposed = True > > > > 'Public WithEvents Acapp As AutoCAD.AcadApplication > > Public acapp As AutoCAD.AcadApplication > > Public WithEvents Adoc As AutoCAD.AcadDocument > > Attribute Adoc.VB_VarHelpID = -1 > > > > Public Function Iniciar(tAcadapp As AutoCAD.AcadApplication) As Long > > > > Dim myform As Form > > Set acapp = tAcadapp > > Set Adoc = acapp.ActiveDocument > > dimlayer = "DimLayer" > > dimcolor = 1 > > End Function > > > > Private Sub Adoc_BeginCommand(ByVal CommandName As String) > > Dim mylayer As AutoCAD.AcadLayer > > Select Case CommandName > > Case "DIMLINEAR", "DIMALIGNED", "DIMORDINATE", "DIMRADIUS", > > "DIMDIAMETER", "DIMANGULAR", "DIMBASELINE", "DIMCONTINUE", "QLEADER", > > "LEADER" > > Set Tactivelayer = acapp.ActiveDocument.ActiveLayer > > > > Set mylayer = acapp.ActiveDocument.Layers.Add(dimlayer) > > mylayer.Color = dimcolor > > mylayer.Lock = False > > mylayer.Freeze = False > > mylayer.LayerOn = True > > acapp.ActiveDocument.ActiveLayer = mylayer > > > > > > End Select > > End Sub > > > > Private Sub Adoc_EndCommand(ByVal CommandName As String) > > Dim temp As String > > Select Case CommandName > > Case "DIMLINEAR", "DIMALIGNED", "DIMORDINATE", "DIMRADIUS", > > "DIMDIAMETER", "DIMANGULAR", "DIMBASELINE", "DIMCONTINUE", "QLEADER", > > "LEADER" > > acapp.ActiveDocument.ActiveLayer = Tactivelayer > > > > End Select > > End Sub > > > > > > > > -- > > Saludos, > > Ing. Jorge Jimenez > > SICAD S.A., Costa Rica > > > > > > "Tony Tanzillo" wrote in message > > news:40aa5d17$1_3@newsprd01... > > > My next suggestion is to try using the Document's > > > BeginCommand and EndCommand events, rather than > > > the Application's > > > > > > -- > > > http://www.caddzone.com > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > http://www.acadxtabs.com > > > > > > > > > "Jorge Jimenez" wrote in message > > news:40aa5790$1_2@newsprd01... > > > > I commented out the Select Case statement entirely > > > > and the wierd DIMCONTINUE behavior IS STILL HAPPENING !! > > > > > > > > There is no code in the begin and end command events > > > > except a dim. > > > > > > > > Now this is very strange indeed.!! > > > > > > > > -- > > > > Saludos, > > > > Ing. Jorge Jimenez > > > > SICAD S.A., Costa Rica > > > > > > > > "Tony Tanzillo" wrote in message > > > > news:40aa4eb6_3@newsprd01... > > > > > What happens if you comment out the Select Case > > > > > statement entirely? > > > > > > > > > > -- > > > > > http://www.caddzone.com > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > news:40aa405e_2@newsprd01... > > > > > > Thank for the reply. > > > > > > I have no doubt you are correct about that being a > > > > > > cause for many problems. > > > > > > > > > > > > But in this case, I'm not so sure about this. > > > > > > > > > > > > I have included the same DLL, but with the code > > > > > > for changing the layer commented out. > > > > > > So inside the begin and end command events > > > > > > there is ONLY a SELECT CASE which does > > > > > > NOTHING. > > > > > > > > > > > > So, if I'm not mistaken, of course, the document state > > > > > > should not change due to the select case statement. > > > > > > > > > > > > And still, AutoCAD presents the same weird behavior. > > > > > > > > > > > > -- > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > "Tony Tanzillo" wrote in message > > > > > > news:40aa396a_3@newsprd01... > > > > > > > Jorge - It may be any change the the document state > > > > > > > that triggers the problem. For example, doing nothing > > > > > > > but calling the Select() method, or one of its variants, > > > > > > > can change the document state (the Previous selection > > > > > > > set is changed). > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > http://www.caddzone.com > > > > > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > > > news:40a9816f$1_1@newsprd01... > > > > > > > > Thanks for the reply Tony. > > > > > > > > > > > > > > > > Actually, the real dll does not change the layer at the > > > > > > > > begincommand event, it stores a count of the entities > > > > > > > > at the moment the command begins, and then compares > > > > > > > > that count with the count at the endcommand event. > > > > > > > > Then it changes the layer of the new entities. > > > > > > > > The problems happens no matter how this is done. > > > > > > > > > > > > > > > > I agree with you about the cache factor, but the fact that > > > > > > > > it only happens with certain values of the dimscale variable > > > > > > > > makes this behavior quite different. > > > > > > > > > > > > > > > > I made this test dll as simple as possible to make sure > > > > > > > > everyone could see the behavior without thinking it > > > > > > > > could be some other event going on. > > > > > > > > > > > > > > > > I even took out the change layer code in the events, and > > > > > > > > the problem persited. > > > > > > > > > > > > > > > > -- > > > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > > > "Tony Tanzillo" wrote in message > > > > > > > > news:40a979d4$1_3@newsprd01... > > > > > > > > > Jorge - The fact that this happens is not something > > > > > > > > > I would find shocking. > > > > > > > > > > > > > > > > > > Generally, making changes to the database in events > > > > > > > > > like the ones you're using, can lead to unpredicable > > > > > > > > > behavior. One reason why (but not necessarily the one > > > > > > > > > that is causing this particular problem), is because > > > > > > > > > many AutoCAD commands, especially older ones, locally > > > > > > > > > cache things like the active layer and other relevant > > > > > > > > > data used in the creation of new entities. So, in fact, > > > > > > > > > changing the active layer after the fact, can actually > > > > > > > > > be ignored by some commands because they may have > > > > > > > > > already made a local copy of the value of the CLAYER > > > > > > > > > system variable. > > > > > > > > > > > > > > > > > > Of course, it can depend on the mechanics of the > > > > > > > > > command, and when the reactor/event is fired, but > > > > > > > > > generally, doing the kind of things you're doing > > > > > > > > > entails the risk of unpredicable behavior, on a > > > > > > > > > command-specific basis. > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > http://www.caddzone.com > > > > > > > > > > > > > > > > > > AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 > > > > > > > > > http://www.acadxtabs.com > > > > > > > > > > > > > > > > > > > > > > > > > > > "Jorge Jimenez" wrote in message > > > > > > > > news:40a96ad2_2@newsprd01... > > > > > > > > > > Can anyone confirm the following bug and where it's coming > > from > > > > ? > > > > > > > > > > > > > > > > > > > > 1. Unzip the included "DLLTest.dll" and "DLLTest.lsp" in a > > temp > > > > dir > > > > > > > > > > 2. Regsvr32 DLLTest.dll > > > > > > > > > > 3. Load AutoCAD 2000-2002 (it also happens with 2004 and > > 2005, > > > > just > > > > > > > > change > > > > > > > > > > the reference lib in the dll project and recompile) > > > > > > > > > > 4. Select "Start from Scratch", "metric" > > > > > > > > > > 5. Load the lisp "DLLtest.lsp" > > > > > > > > > > 6. write DIMSCALE, and enter a value of 1.8 > > > > > > > > > > 7. Use the DIMENSION menu and select LINEAR. Dim any two > > points > > > > > > > > > > 8. Use the DIMENSION menu and select CONTINUE. Move the > > cursor > > > > and > > > > > > > > watch > > > > > > > > > > the dimcontinue command go bezerk !! > > > > > > > > > > > > > > > > > > > > Now, if CANCEL and enter a DIMSCALE value of 1.0 to 1.5, the > > > > > > dimcontinue > > > > > > > > > > works again !! > > > > > > > > > > > > > > > > > > > > The zip includes the source for the VB6 dlltest.dll > > > > > > > > > > > > > > > > > > > > TIA > > > > > > > > > > -- > > > > > > > > > > Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica > > > > > > > > > > (sorry, phony e-mail, SPAM made me do it) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost