Hello all,
I have this routine which allows me to copy objects from a drawing and when I paste it into another it will put the original drawings name below it. The problem now is that I will have to add a suffix to some of my drawings that indicates the sheet size, i.e drawing of something (11x17).dwg. I need to strip the red part off if it appears in the filename. How would I modify this to make this possible
;copy selected objects to clipboard based on specified basepoint and when pasted in drawing, a mtext label will be created
;4.5" below the insertion point. text will be created on the "I-FIXT-CASE_IDEN" layer, if it doesn't exist, it is created.
;alan thompson 4.16.08
(defun C:CPD()
(setq base_point (getpoint "\nSpecify base point: "))
(princ "\nSelect objects to copy: ")
(setq copy_objects (ssget))
(if copy_objects
(progn
(setvar "insunits" 0)
(setq ptascii_x (car base_point))
(setq ptascii_x (rtos ptascii_x 2 2))
(setq ptascii_y (cadr base_point))
(setq point_calc (rtos (- ptascii_y 4.5)))
(setq label_base (strcat ptascii_x "," point_calc))
(setq clay (getvar "clayer"))
(if (not (tblsearch "layer" "I-FIXT-CASE_IDEN"))
(command "-layer" "m" "I-FIXT-CASE_IDEN" "C" "11" "" "")
(command "-layer" "t" "I-FIXT-CASE_IDEN" "m" "I-FIXT-CASE_IDEN" "C" "11" "" "")
);if
(command "mtext" label_base "Style" "Romans" "h" "4.5" "j" "mc" "w" "0.85" (strcase (vl-filename-base (getvar "dwgname"))) "")
(setq text_label (entlast))
(command "copybase" base_point copy_objects text_label "")
(command "erase" text_label "")
(setvar "clayer" clay)
);progn
);if
(princ)
);defun