Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

vlr-acdb-reactor :vlr-objectModified AutoCAD 2014 crashes after ROTATE command

13 REPLIES 13
SOLVED
Reply
Message 1 of 14
Anonymous
2633 Views, 13 Replies

vlr-acdb-reactor :vlr-objectModified AutoCAD 2014 crashes after ROTATE command

Please, does anyone knows why this simple routine crashes AutoCAD 2014 when user rotates any object ?!?

All other "modify category" commands work with no problems.

 

(And AutoCAD 2011 does not have this issue ?!?)

 

(defun tst ()

  (vl-load-com)

  (vlr-acdb-reactor nil '((:vlr-objectModified . RBS_ObjectModified)))

 

(defun RBS_ObjectModified (rctr objct)

  (print (cdr (assoc 0 (entget (cadr objct)))))

)

 

Thank you !

13 REPLIES 13
Message 2 of 14
dbroad
in reply to: Anonymous

Works fine for me on a small drawing.  It might help to post your drawing.

Architect, Registered NC, VA, SC, & GA.
Message 3 of 14
Anonymous
in reply to: dbroad

Thank you for the response,

 

I'm testing this in AutoCAD 2014 in a new drawing with just one line (!?!), so I beleive it would make no sense to send you that kind of dwg.

 

This is what and how I do:

 

I draw a line, then I load this lisp procedure and execute it by typing (tst) on command line.

After that when I rotate the line AutoCAD crashes.

 

Did you do the same, and AutoCAD 2014 is not crashing ?

(if lisp is active then after each "modify command" it writes type of entity that was modified...)

 

 

 

 

 

 

Message 4 of 14
bhull1985
in reply to: dbroad

Look below, this post is made invalid with further testing

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 5 of 14
bhull1985
in reply to: bhull1985

Worked fine I think.

 

Command: (tst) #<VLR-AcDb-Reactor>

 

Command: _rotate

Current positive angle in UCS:  ANGDIR=counterclockwise  ANGBASE=0.00000000

1 found

Specify base point:

Specify rotation angle or [Copy/Reference] <0.00000000>:

"ATTRIB"

"ATTRIB"

"ATTRIB"

"ATTRIB"

"ATTRIB"

"ATTRIB"

"ATTRIB"

"ATTRIB"

"ATTRIB"

"ATTRIB"

"ATTRIB"

"SEQEND"

"INSERT"

"LAYOUT"

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 6 of 14
bhull1985
in reply to: bhull1985

And then about 30 seconds later ACAD stopped responding.

 

I take it back!

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 7 of 14
Anonymous
in reply to: bhull1985

I'm glad that I'm not getting crazy, but not glad that problem indeed exist.

There must have been some hidden change in AutoCAD object model, since this worked fine in AutoCAD 2011 (did not have an oportunuty to use it in 2012 & 2013)

Message 8 of 14
Anonymous
in reply to: bhull1985

The problem is in AutoCAD 2014
Message 9 of 14
bhull1985
in reply to: Anonymous

Yes I can confirm for you that there were huge changes to the object model after 2011.

This has prevented another much-desired routine from continued performance. The visibility-add-eng routine for adding more than one visibility state to a dynamic block was destroyed by these changes to the object model and the complexity of the routine has hindered anyone else from completing it under the new object model specifications.

In summary- you're not the only one who's had an existing routine smashed due to the object model upgrades.

Sorry, but hopefully that helps your sanity some 🙂

As far as fixing your reactor, you'd need to find someone experienced with coding them. I am not that person unfortunately, else I'd help ya.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 10 of 14
Anonymous
in reply to: bhull1985

Thank you for the effort !Smiley Wink

Message 11 of 14
dbroad
in reply to: Anonymous

1)Avoid acdb reactors.  Use them as last resorts only and remove them as soon as the need has been fullfilled. That has been the advice since vlr reactors have been added.

2)Avoid duplicating acdb reactors.  They are very active.  They will slow autocad down.  It is entirely possible for them to crash AutoCAD if left running.

 

One method would be to decide what you want to track and only track that.  For example, if you are trying to track the rotate command, use a command reactor to set up the acdb reactor at the command's start point.  Then remove the addb reactor after the command is finished.

Architect, Registered NC, VA, SC, & GA.
Message 12 of 14
Anonymous
in reply to: dbroad

I want to keep track on handles of block instances of certain kind upon which were aplied move, copy, mirror, rotate, align events, so I could perform some actions in command_ended.

 

Any suggestions ?

 

And I would really apreciate the example of removing the reactor as I could not find any in AutoCAD 2014 help !?!

Maybe aplied on the code I presented in my question.

Thank you !

Message 13 of 14
dbroad
in reply to: Anonymous

Use object reactors to track specific objects.  Use xdata to help setup the reactors when the drawing is opened. Xdata is owned by a particular application.  Register your application so that you can access which objects are "owned" by the application.

 

The code example below is just an adaptation of your code to show you how to remove a reactor. In general avoid, acdb reactors.

(if myreactor (vlr-remove myreactor));remove your reactors on load to avoid duplication.

(defun tst () (vl-load-com) (setq myreactor (vlr-acdb-reactor nil '((:vlr-objectModified . RBS_ObjectModified)) ) ) ) (defun RBS_ObjectModified (rctr objct) (print (cdr (assoc 0 (entget (cadr objct))))) ) (defun untst () ;to turn your reactor off (untst) (vlr-remove myreactor))

 You can also remove all reactors with (vlr-remove-all)

 

BTW, you should use one login name for all your threads.

Architect, Registered NC, VA, SC, & GA.
Message 14 of 14
Anonymous
in reply to: dbroad

Thank you !

 

With your help I made it work !

 

PS

I have only one login name on this forum, maybe one of my friends which I asked for help posted similar question.

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

Post to forums  

Autodesk Design & Make Report

”Boost