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

Undo Mark & Back via (vla-...) functions?

4 REPLIES 4
Reply
Message 1 of 5
Kent1Cooper
2808 Views, 4 Replies

Undo Mark & Back via (vla-...) functions?

Does anyone know of a way to perform the equivalent of the Undo Mark & Back options in AutoLISP via (vla-...) functions, or in any way other than by running the command outright and supplying the options?  I've looked through several listings of (vla-...) functions, and they all include (vla-startundomark) and (vla-endundomark) functions, which are equivalent to Undo BEgin & End, but I don't see anything equivalent to the Mark & Back options.  A Search here didn't turn anything up.

 

I'm working on a routine that uses both BEgin/End [for the overall routine] and Mark/Back [for one-item-at-a-time undoing within the routine] options in Undo.  If the Mark/Back options can be done only via Undo commands, then I'll want to save and turn off and reset command echoing.  But that's the only command operation the routine needs, so if there's another way to do Mark/Back, similar to the way the BEgin/End options can be handled, it will eliminate the need for dealing with CMDECHO, and a variable to do that with.  [And it would probably be faster, though in this case not noticeably.]

Kent Cooper, AIA
4 REPLIES 4
Message 2 of 5
Gary_J_Orr
in reply to: Kent1Cooper

Sorry Kent... None that I'm aware of from either Vlisp or via the ActiveX interface (vla-***)...

In .Net you could wrap each "loop" in a transaction and decide weather or not to commit that transaction via user input but through Vlisp/ActiveX I can't find a way.

If your concern is about having a potential stray variable and potentially not resetting the cmdecho to it's previous state in case of some unexpected and possibly unhandled error you could possibly create "mini" defun statements for the mark and back options in which you collect the setting, change it, issue the desired undo command, then reset the echo and clear the var... (I'm typing this on the fly so spelling and syntax may not be accurate

(defun setuMark ( / OldEcho)
(setq OldEcho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "_undo" "" "mark" "")
(setvar "cmdecho" OldEcho)
)

But that just seems like a lot of overkill when your error handler can manage the task easily.enough.

-Gary
Gary J. Orr
(Your Friendly Neighborhood) CADD/BIM/VDC Applications Manager
http://www.linkedin.com/in/garyorr

aka (current and past user names):
Gary_J_Orr (GOMO Stuff 2008-Present); OrrG (Forum Studio 2005-2008); Gary J. Orr (LHB Inc 2002-2005); Orr, Gary J. (Gossen Livingston 1997-2002)
Message 3 of 5

Hi all

 

 

There are two functions you can call

 

 

(Setq thisdrawing (vla-get-activedocument (vlax-get-acad-object)))

(vla-startundomark thisdrawing)

(vla-endundomark thisdrawing)

 

I hope i could help... 

Message 4 of 5


@cristian.leon.gonzalez wrote:

.... 

There are two functions you can call

.... 


Thanks for the suggestion, but I already use those all the time.  They are equivalent to the BEgin and End options in UNDO, but I was looking for something equivalent to the Mark and Back options, which are different.  Read Post 1 again, and Help about UNDO to understand the differences.

Kent Cooper, AIA
Message 5 of 5
john.uhden
in reply to: Kent1Cooper

There are plenty of vlr-undo methods (reactor thingies), but I have never used them.

I see no problem using (command ...).

John F. Uhden

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

Post to forums  

Autodesk Design & Make Report

”Boost