I don't see anything wrong with codes and they seem to be not outdated.
Sometimes the references blow off and that messes the macro and hence crashes SW.
If I were to write that macro today I don't see anything in particular that I'd do different. I'm not sure what is actually happening unless possibly the second run of the macro is trying to do things during the graphics redraw or something. Maybe if ClearSelection2 is happening right when GetSelectedObject is trying to happen?
I did poke around a little bit to see if I could figure out how to tell if a certain macro is already running, or a way to disable further macros, but I didn't see one that was immediately apparent. It might be possible to have the macro check some system or document setting whenever it starts up, then toggle that setting on/off during running. Then right at the end it would toggle the setting back to the original value.
I'm sure Keith or someone can figure out a much more elegant method than that though.
Deepak & Josh,
Thank you both for taking a look. If Keith has any input I look forward to hearing that as well.
I couldn't have asked for more from the forum than to have some of the sharpest API guys chime in.
I cannot get this to work for me. when I copy and paste this into my macro creator
You need to have a ordinate dimension selected before running this macro.