Something like this
(setq obj (vlax-ename->vla-object (entlast)))
(setq cpt (osnap (vlax-curve-getStartPoint obj) "gcen"))
Thanks to Kent Cooper for the hint about gcen
A similar approach to set or reset Vars
(setq vars (list '("insunits" 6) '("Insunitsdefsource" 6) '("INSUNITSDEFTARGET" 6)'("lunits" 2)'("luprec" 3)'("aunits" 1) ))
(foreach var vars
(setvar (car var)(cadr var))
)
You can add the existing setting in the list
(setq vars (list '("insunits" 6 (getvar 'insunits)) '("Insunitsdefsource" 6 (getvar Insunitsdefsource)) '("INSUNITSDEFTARGET" 6 (getvar 'INSUNITSDEFTARGET)) '("lunits" 2 (getvar 'lunits))'("luprec" 3 (getvar 'luprec))'("aunits" 1 (getvar 'aunits)) ))
So at end rest back to original.
(setvar (car var)(caddr var))
Helping others does not mean 'a play' to me if that's your opinion , so if you are after that program then come and pay for it and I will make it for you unless you are like that guy who is messing up with all threads for the sake of number of posts.
Don't be panic from my frankness because I can't say other than what I believe.
As I said you are not following, the member who asked for number incrementing codes is different that the OP and they have different tag name as they already claimed that in their earlier replies.
Thank you so very much GP_ and Gu_xl for sharing a fantastic program. Sorry my "thanks" are 10 years late but I didn't see this the first time around. Truly great programming! I have already added to my toolbox.