@danglar wrote:
....
This command (created by Kent Cooper and slightly modified by me) can mirror object by one click
(defun c:MV ()
(command
"_.mirror"
pause ""
"_none" "@"
"_none" "@0,1"
"_yes"
)
)
but when I invoke this function osnap not working at all
Is it possible to change this code in order to involve osnap selection to working process?
....
If you want Osnap on for the object selection to be at some Osnappable location among the modes you have set, then you would have to use (getpoint) instead of just a pause for object selection, because Osnap doesn't work during object selection when you run an editing command manually, either. If you save a point that you get with Osnap, you can then use that point for the selection, rather than a pause.
Try something like this [lightly tested]:
(defun c:MVO (/ pt); = Mirror across Vertical axis, with Object Snap for selection
(setq pt (getpoint "\nOsnap-select single object at vertical-Mirror-axis location: "))
(command
"_.mirror"
pt ""
"_none" "@"
"_none" "@0,1"
"_yes"
)
)
That depends on your having Osnap running. If you might not always have running Osnap modes going, you could decide on a combination that would always work for your purposes, and build the setting of OSMODE to that value into the beginning of the routine.
Kent Cooper, AIA