bao Posted November 11, 2008 Posted November 11, 2008 What's going on, guys? Anybody have the "chop lisp"? I have a new computer and I wasn't able to save some of my files so I lost my "lsp's". It something that would trim the line but you can give a certain value on how you want it trimmed on each side. Thanks in advance, really appreciate it. Bao Quote
GhostRider Posted November 11, 2008 Posted November 11, 2008 Is this the one? I don't think it is this is for text (defun C:CHOP (/ rad2deg txt2edit chopword entname entdata dotpairtxt dotpairht ht dotpairang rotang longtxt wordlen longtxtlen counter teststr) (setvar "CMDECHO" 0) (setq Rad2Deg (/ 360 pi 2)) (setq Txt2Edit (ssget)) (setq ChopWord (getstring "\nChop after what word?: ")) (setq EntName (ssname Txt2Edit 0)) (setq EntData (entget EntName)) (setq DotPairTxt (assoc (quote 1.0) EntData)) (setq DotPairHt (assoc (quote 40.0) EntData)) (setq Ht (cdr DotPairHt)) (setq DotPairAng (assoc (quote 50.0) EntData)) (setq RotAng (cdr DotPairAng)) (setq RotAng (* RotAng Rad2Deg)) (setq LongTxt (cdr DotPairTxt)) (setq WordLen (strlen ChopWord)) (setq LongTxtLen (strlen LongTxt)) (FINDWORD) ) (defun FINDWORD () (setq Counter 1) (setq TestStr (substr LongTxt Counter WordLen)) (while (not (equal TestStr ChopWord)) (progn (setq Counter (+ 1 Counter)) (setq TestStr (substr LongTxt Counter WordLen)) ) ) (FINISHED) ) (defun FINISHED (/ beforlen befortxt aftstart afttxt aftpt) (setq BeforLen (+ Counter WordLen)) (setq BeforTxt (substr LongTxt 1 BeforLen)) (setq AftStart (+ 1 BeforLen)) (setq AftTxt (substr LongTxt AftStart)) (command "CHANGE" "prev" "" "" "" "" "" "" BeforTxt) (setq AftPt (getpoint "\nStarting point of remaining text:")) (command "TEXT" AftPt Ht RotAng AftTxt) (setvar "CMDECHO" 1) ) (prompt "\nCommand: CHOP - Break a text string\n") Quote
bao Posted November 11, 2008 Author Posted November 11, 2008 yes ghost, the command is CHOP but it is not for text. it is for lines like if you're drawing a diagram and you want to trim a line that crossed. so instead of using "TRIM", you use chop. do you have it? can you email it to me if it's ok with you? my email is rlapaz@dvpe.net thanks. Quote
lpseifert Posted November 11, 2008 Posted November 11, 2008 Wouldn't the Lengthen command work? Quote
CmdrDuh Posted November 11, 2008 Posted November 11, 2008 I have one called bkwr that might be what you want (DEFUN C:Bkwr (/ PT PT1 PT2 PT3 A1) (modes '("CMDECHO" "osmode" "orthomode")) (PROMPT "\n \nBreak @ Intersection") (INITGET 1) (SETVAR "OSMODE" 32) (COMMAND "SNAP" "OFF") (setq dsc (getvar "dimscale")) (SETQ PT1 (GETPOINT "\n\n Pick intersection to be broken: ")) (SETVAR "OSMODE" 0) (INITGET 33) (SETVAR "OSMODE" 512) (SETQ PT (GETPOINT PT1 "\n Pick Line to be broken: ")) (IF (= BRKW NIL) (SETQ BRKW 0.0625) ;set wire gap here. Gap is double the value set ) (SETQ A1 (ANGLE PT1 PT) PT2 (POLAR PT1 A1 (* dsc BRKW)) PT3 (POLAR PT1 (+ A1 PI) (* dsc BRKW)) ) (COMMAND ".BREAK" PT "F" PT2 PT3) (moder) ) 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.