minhphuong_humg Posted February 9, 2015 Posted February 9, 2015 Hi, all. I have a drawing big. I want copy frames to another. Please, write a lisp help me to do. Thank you very much! File attach: File dwg: https://www.mediafire.com/?v7qn32qcaq2ighf Thank you! Quote
BIGAL Posted February 10, 2015 Posted February 10, 2015 Try using a layout with big picture then little layouts use zoom C to pick point inside little layout and set scale etc. Quote
Stefan BMR Posted February 10, 2015 Posted February 10, 2015 I would go with BIGAL's suggestion, but if you want to work in Model space, try this old routine. (defun C:CUT (/ *error* e p1 p2 p3 ss echo osmode) (setq echo (getvar "cmdecho")) (setq osmode (getvar "OSMODE")) (defun *error* (msg) (if msg (princ msg)) (command "_UNDO" "E") (setvar "OSMODE" osmode) (setvar "cmdecho" echo) (princ) ) (setvar "OSMODE" 0) (setvar "cmdecho" 0) (if (and (setq p1 (getpoint "\nFirst corner: ")) (setq p2 (getcorner p1 "\nSecond corner: ")) (progn (if (not etrim) (load "extrim.lsp" "Extrim not found")) T) etrim ) (progn (command "_RECTANGLE" p1 p2) (command "_UNDO" "BE") (setq e (entlast)) (setq p3 (polar p1 (angle p2 p1) (* 0.5 (distance p1 p2)))) (etrim e p3) ;;; (entdel e ) (setq ss (ssget "W" p1 p2)) (command "_copybase" p2 ss "") (command "_UNDO" "B") (command "_pasteclip" pause) ) ) (command "_UNDO" "E") (setvar "OSMODE" osmode) (setvar "cmdecho" echo) (princ) ) Quote
minhphuong_humg Posted February 11, 2015 Author Posted February 11, 2015 I would go with BIGAL's suggestion, but if you want to work in Model space, try this old routine. (defun C:CUT (/ *error* e p1 p2 p3 ss echo osmode) (setq echo (getvar "cmdecho")) (setq osmode (getvar "OSMODE")) (defun *error* (msg) (if msg (princ msg)) (command "_UNDO" "E") (setvar "OSMODE" osmode) (setvar "cmdecho" echo) (princ) ) (setvar "OSMODE" 0) (setvar "cmdecho" 0) (if (and (setq p1 (getpoint "\nFirst corner: ")) (setq p2 (getcorner p1 "\nSecond corner: ")) (progn (if (not etrim) (load "extrim.lsp" "Extrim not found")) T) etrim ) (progn (command "_RECTANGLE" p1 p2) (command "_UNDO" "BE") (setq e (entlast)) (setq p3 (polar p1 (angle p2 p1) (* 0.5 (distance p1 p2)))) (etrim e p3) ;;; (entdel e ) (setq ss (ssget "W" p1 p2)) (command "_copybase" p2 ss "") (command "_UNDO" "B") (command "_pasteclip" pause) ) ) (command "_UNDO" "E") (setvar "OSMODE" osmode) (setvar "cmdecho" echo) (princ) ) Dear, Stefan BMR! I like your way because it is my habit (working on the model)! However, if I start on 2 corner points of the rectangular frame is available autolisp work does not seem exactly like the frame to cut autolisp draw. So you can edit autolisp by selecting frame (rectangle)? Please, help me! If so, great. Thanks and best regards! P / S: Because, when i load your lisp is Snap (Osnap) Clear all instead select my routine (Endpoint, Midpoint, Nearest) Thank Stefan BMR very much! Quote
Stefan BMR Posted February 11, 2015 Posted February 11, 2015 (edited) minhphuong_humg said: Dear, Stefan BMR! I like your way because it is my habit (working on the model)! However, if I start on 2 corner points of the rectangular frame is available autolisp work does not seem exactly like the frame to cut autolisp draw. So you can edit autolisp by selecting frame (rectangle)? Please, help me! If so, great. Thanks and best regards! P / S: Because, when i load your lisp is Snap (Osnap) Clear all instead select my routine (Endpoint, Midpoint, Nearest) Thank Stefan BMR very much! Try this one. You can't select an object, but Osnap setting is available. (defun C:CUT (/ *error* e p1 p2 p3 ss echo undo) (setq echo (getvar "cmdecho")) (defun *error* (msg) (if msg (princ msg)) (setvar "cmdecho" echo) (princ) ) (if (and (setq p1 (getpoint "\nFirst corner: ")) (setq p2 (getcorner p1 "\nSecond corner: ")) (not (equal p1 p2 1e-5)) (progn (if (not etrim) (load "extrim.lsp" "Extrim not found")) T) etrim ) (progn (setvar "cmdecho" 0) (setq undo (getvar 'undoctl)) (if (= 0 (logand 1 undo)) (command "_UNDO" "_ALL")) (command "_RECTANGLE" "_non" p1 "_non" p2) (command "_UNDO" "_M") (setq e (entlast)) (etrim e (getvar 'vsmin)) (command "_zoom" "_o" e "") (setq ss (ssget "W" p1 p2)) (command "_copybase" p2 ss "") (command "_UNDO" "_B") (command "_pasteclip" pause) (if (= 0 (logand 1 undo)) (command "_UNDO" "_C" "_NONE")) (setvar "cmdecho" echo) ) ) (*error* nil) (princ) ) Edited November 7, 2018 by Stefan BMR Quote
minhphuong_humg Posted February 12, 2015 Author Posted February 12, 2015 Try this one. You can't select an object, but Osnap setting is available. (defun C:CUT (/ *error* e p1 p2 p3 ss echo undo) (setq echo (getvar "cmdecho")) (defun *error* (msg) (if msg (princ msg)) (setvar "cmdecho" echo) (princ) ) (if (and (setq p1 (getpoint "\nFirst corner: ")) (setq p2 (getcorner p1 "\nSecond corner: ")) (not (equal p1 p2 1e-5)) (progn (if (not etrim) (load "extrim.lsp" "Extrim not found")) T) etrim ) (progn (setvar "cmdecho" 0) (setq undo (getvar 'undoctl)) (if (= 0 (logand 1 undo)) (command "_UNDO" "_ALL")) (command "_RECTANGLE" "_non" p1 "_non" p2) (command "_UNDO" "_M") (setq e (entlast)) (etrim e (getvar 'vsmin)) (setq ss (ssget "W" p1 p2)) (command "_copybase" p2 ss "") (command "_UNDO" "_B") (command "_pasteclip" pause) (if (= 0 (logand 1 undo)) (command "_UNDO" "_C" "_NONE")) (setvar "cmdecho" echo) ) ) (*error* nil) (princ) ) Dear Stefan BMR! It seems that you have not checked out my drawings sent. I downloaded your lisp and try again on my drawings are not working lisp (selected corners of the rectangular frame). Please try directly on my drawing (attached). File attach: http://www.mediafire.com/download/v7qn32qcaq2ighf/Help_Copy_Frame.dwg Sincerely BMR. File video demo your lisp: Thank you very much! Quote
Stefan BMR Posted February 12, 2015 Posted February 12, 2015 Add the red line .......... (etrim e (getvar 'vsmin)) [color=red](command "_zoom" "_o" e "")[/color] (setq ss (ssget "W" p1 p2)) .............. Quote
minhphuong_humg Posted February 24, 2015 Author Posted February 24, 2015 Add the red line .......... (etrim e (getvar 'vsmin)) [color=red](command "_zoom" "_o" e "")[/color] (setq ss (ssget "W" p1 p2)) .............. Thank Stefan BMR very much! Quote
minhphuong_humg Posted March 7, 2015 Author Posted March 7, 2015 Dear Stefan BMR!It seems that you have not checked out my drawings sent. I downloaded your lisp and try again on my drawings are not working lisp (selected corners of the rectangular frame). Please try directly on my drawing (attached). File attach: http://www.mediafire.com/download/v7qn32qcaq2ighf/Help_Copy_Frame.dwg Sincerely BMR. File video demo your lisp: Thank you very much! Dear Stefan BMR! After a time using your lisp. I found that the only option was lisp squares that look the other shapes (polygons) .You please revise your lisp help me so that I can select different shapes? I am very grateful to you! Sincerely thank Stefan BMR! File attachment image. [shape color magenta] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.