Hello All,
I have a routine that I have had some help with from people in this Discussion Groups. Their names are listed in the routine. I am in need of an addition to this routine. Let me explain.
As it stands now this routine will ask the user to select a line and the side to offset. Then offset the selected line as a pline to the selected side with a layer, linetype, width, etc. set by the routine.
Now, I need an addition to this routine that will ask the user to select two lines (hopefully parallel), find the midpoint between those two lines and then create a pline down the middle of the two selected lines with the pline layer, linetype, width, etc. set by the routine.
I am pasting the original code in here. Any help would be great. Thanks in advance.
"Catch" Ya Later,
AKDRAFTER
;;;
;;; Timothy J. Jaronik Sr.
;;; December, 2003
;;;
;;; Credit goes to the following people
;;; from the Auotdesk Discussion Groups(ADG)
;;; for their help with this routine
;;;
;;; Joe Burke
;;; Bob Shaw
;;; TCEBob <<<<ADG Handle Not sure what his real name is ;; ;; ;;;;;;;;;;;;;;;BEGIN ERROR HANDLING FUNCTION;;;;;;;;;;;;;;; ;; (defun *ERROR* (msg) (princ "\nerror: ") (if msg (princ msg)) (setvar "CMDECHO" CME) (setvar "OSMODE" OSM) (setvar "SNAPMODE" SNM) (setvar "CLAYER" CLA) (prompt "\nResetting System Variables... ") (princ) ) ;; ;;;;;;;;;;;;;;;END ERROR HANDLING FUNCTION;;;;;;;;;;;;;;; ;; (defun c:SW ( / CME OSM SNM CLA L1 L2 SID) (setq CME(getvar "CMDECHO")) (setvar "CMDECHO" 0) (setq OSM(getvar "OSMODE")) (setvar "OSMODE" 0) (setq SNM(getvar "SNAPMODE")) (setvar "SNAPMODE" 0) (setq CLA(getvar "CLAYER")) (command "-layer" "thaw" "S-SHEAR" "on" "S-SHEAR" "make" "S-SHEAR" "color" "1" "S-SHEAR" "lt" "hidden" "S-SHEAR" "") (while (or (not (setq L1 (entsel "\nSelect Line: "))) (/= "LINE" (cdr (assoc 0 (entget (car L1))))) ) (princ "\nMissed Pick or Wrong Object Type" ) ) (setq SID(getpoint "\nSide To Offset To: ")) (command "offset" "3" L1 SID "") (setq L2(entlast)) (command "change" L2 "" "p" "layer" "S-SHEAR" "color" "bylayer" "lt" "bylayer" "") (command "pedit" L2 "Y" "w" "2.50000000" "") (setvar "CMDECHO" CME) (setvar "OSMODE" OSM) (setvar "SNAPMODE" SNM) (setvar "CLAYER" CLA) (princ)
)
I have a routine that I have had some help with from people in this Discussion Groups. Their names are listed in the routine. I am in need of an addition to this routine. Let me explain.
As it stands now this routine will ask the user to select a line and the side to offset. Then offset the selected line as a pline to the selected side with a layer, linetype, width, etc. set by the routine.
Now, I need an addition to this routine that will ask the user to select two lines (hopefully parallel), find the midpoint between those two lines and then create a pline down the middle of the two selected lines with the pline layer, linetype, width, etc. set by the routine.
I am pasting the original code in here. Any help would be great. Thanks in advance.
"Catch" Ya Later,
AKDRAFTER
;;;
;;; Timothy J. Jaronik Sr.
;;; December, 2003
;;;
;;; Credit goes to the following people
;;; from the Auotdesk Discussion Groups(ADG)
;;; for their help with this routine
;;;
;;; Joe Burke
;;; Bob Shaw
;;; TCEBob <<<<ADG Handle Not sure what his real name is ;; ;; ;;;;;;;;;;;;;;;BEGIN ERROR HANDLING FUNCTION;;;;;;;;;;;;;;; ;; (defun *ERROR* (msg) (princ "\nerror: ") (if msg (princ msg)) (setvar "CMDECHO" CME) (setvar "OSMODE" OSM) (setvar "SNAPMODE" SNM) (setvar "CLAYER" CLA) (prompt "\nResetting System Variables... ") (princ) ) ;; ;;;;;;;;;;;;;;;END ERROR HANDLING FUNCTION;;;;;;;;;;;;;;; ;; (defun c:SW ( / CME OSM SNM CLA L1 L2 SID) (setq CME(getvar "CMDECHO")) (setvar "CMDECHO" 0) (setq OSM(getvar "OSMODE")) (setvar "OSMODE" 0) (setq SNM(getvar "SNAPMODE")) (setvar "SNAPMODE" 0) (setq CLA(getvar "CLAYER")) (command "-layer" "thaw" "S-SHEAR" "on" "S-SHEAR" "make" "S-SHEAR" "color" "1" "S-SHEAR" "lt" "hidden" "S-SHEAR" "") (while (or (not (setq L1 (entsel "\nSelect Line: "))) (/= "LINE" (cdr (assoc 0 (entget (car L1))))) ) (princ "\nMissed Pick or Wrong Object Type" ) ) (setq SID(getpoint "\nSide To Offset To: ")) (command "offset" "3" L1 SID "") (setq L2(entlast)) (command "change" L2 "" "p" "layer" "S-SHEAR" "color" "bylayer" "lt" "bylayer" "") (command "pedit" L2 "Y" "w" "2.50000000" "") (setvar "CMDECHO" CME) (setvar "OSMODE" OSM) (setvar "SNAPMODE" SNM) (setvar "CLAYER" CLA) (princ)
)