View Full Version : Help updating a program to offset object
cadd4la
2017-02-13, 05:59 PM
Hi everyone,
I'm looking for help in adding the option to erase the picked object, so I don't have to have two forms of a code for offsetting an object(s).
(defun C:O3 ()
(SETVAR "CMDECHO" 0)
(command "offset" "36")
(SETVAR "CMDECHO" 1)
(princ)
)
Thanks,
Tom Beauford
2017-02-13, 08:07 PM
This works for me, but not sure what the options were for 2010:
(defun C:OffsetDel (/ ss pt)
(prompt "Select object to offset: ")
(setq ss (ssget "+.:E:S" '((0 . "lwpolyline,spline,circle,ellipse"))))
(setq pt (getpoint "Specify point on side to offset: "))
(command "offset" "36" ss pt "")
(command "erase" ss "")
)
In newer versions [Erase] is an option for the OFFSET command.
cadd4la
2017-02-13, 09:19 PM
Tom,
Thanks, for the code but it's not doing what I need it to do and sorry for not making that more clear.
I need the code to ask me do you want the original object erase with a yes or no. I already has a code that is like this and I looking to combine both together so I don't have to have two forms of code to offset an object 3'.
Regards,
Cadd4la
Tom Beauford
2017-02-13, 09:38 PM
Sorry,
(defun C:OffsetDel (/ ss pt)
(prompt "Select object to offset: ")
(setq ss (ssget "+.:E:S" '((0 . "lwpolyline,spline,circle,ellipse"))))
(setq pt (getpoint "Specify point on side to offset: "))
(command "offset" "36" ss pt "")
(initget "Yes No")
(setq RO (getkword "\nDelete original? [Yes/No] <N>: "))
(if (= RO "Yes")
(command "erase" ss "")
)
)
cadd4la
2017-02-13, 09:42 PM
Tom,
That's what I need.
Thanks so much,
Cadd4la
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.