asos2000 Posted August 24, 2008 Posted August 24, 2008 Mr ASMI what a great lisp related to that lisp there is one comment I want to select a text not type again. Second, how did u do that presentation (*.GIF file) thanx and regards Quote
ASMI Posted August 24, 2008 Posted August 24, 2008 > asos2000 what a great lisprelated to that lisp there is one comment I want to select a text not type again. Yes, I have some ideas. And this is one of them. Second, how did u do that presentation (*.GIF file) This animated *.gif is prodused with Camtasia Studio software. It provides to record on-screen user actions, add subtitles, pictures and sound also export into *.avi, *.swf, animated *.gif and some other formats. > CAB Thank you. It while spontaneous idea expressed in a small piece of a code. Completion is required. Quote
asos2000 Posted August 24, 2008 Posted August 24, 2008 waiting for new ideas, and thanx for that program Quote
CAB Posted August 25, 2008 Posted August 25, 2008 OK, One more offering: You may enter the text or press Enter to except last text used by the routine or pick text from the drawing to copy string from. ;;; TextAlignWithObject.lsp ;;; by Charles Alan Butler ;;; Copyright 2007 ;;; by Precision Drafting & Design All Rights Reserved. ;;; Contact at ab2draft @ TampaBay.rr.com ;;; ;;; Version 1.0 Beta Feb 19, 2007 ;;; Version 1.1 Beta Aug 20, 2008, added fuzz to angle detection ;;; Version 1.2 Beta Aug 24, 2008, added text input options ;;; ;;; DESCRIPTION ;;; Add text to DWG at angle of selected object ;;; ;;; ;;; Limitations ;;; No error checking ;;; ;;; ;;; Command Line Usage ;;; Command: TAO ;;; ;;; ;;; This software is provided "as is" without express or implied ; ;;; warranty. All implied warranties of fitness for any particular ; ;;; purpose and of merchantability are hereby disclaimed. ; ;;; You are hereby granted permission to use, copy and modify this ; ;;; software without charge, provided you do so exclusively for ; ;;; your own use or for use by others in your organization in the ; ;;; performance of their normal duties, and provided further that ; ;;; the above copyright notice appears in all copies and both that ; ;;; copyright notice and the limited warranty and restricted rights ; ;;; notice appear in all supporting documentation. ; (defun c:tao() (c:TextAlignWithObject)) ; shortcut (defun c:TextAlignWithObject (/ tmp ang pt txtht FixTextAngle addtext get_pt_and_angle) (vl-load-com) ;; ------------------< sub functions >---------------------- ;; Returns a text angle in radians, flops text at >90 and <270 (defun FixTextAngle (ang) (if (and (> ang (+ (* 0.5 pi) 0.0001)) (< ang (+ (* 1.5 pi) 0.0001))) (+ ang pi) ang ) ) ;; Create a text object (defun addtext (ipt ; insert point hgt ; text height text ; text string ang ; test angle aln ; text alignment lay ; text layer / txtObj) (setq txtObj (vla-addtext (if (= (getvar "cvport") 1) (vla-get-paperspace (vla-get-activedocument (vlax-get-acad-object))) (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) ) text (vlax-3d-point ipt) hgt ) ) (vla-put-layer txtObj lay) (vla-put-rotation txtObj ang) (vla-put-alignment txtObj aln) (vla-put-textalignmentpoint txtobj (vlax-3d-point ipt)) ) ;; User selection of curve object ;; return pick point & average angle of curve at pick point (defun get_pt_and_angle (prmpt / ent p@pt parA parB pt ang) (if (and (setq ent (entsel prmpt)) (not (vl-catch-all-error-p (setq pt (vl-catch-all-apply 'vlax-curve-getClosestPointTo (list (car ent) (cadr ent)) ) ) ) ) ) (progn (setq ent (car ent) p@pt (vlax-curve-getParamAtPoint ent pt) parA (max 0.0 (- p@pt 0.05)) parB (min (+ p@pt 0.05) (vlax-curve-getEndParam ent)) ang (angle (vlax-curve-getPointAtParam ent parA) (vlax-curve-getPointAtParam ent ParB) ) ) (list pt ang) ) ) ) ;; ------------------< START HERE >---------------------- ;; Get text string to insert (or txtstr (setq txtstr "Default Text")) (while ; Loop while getting User Input (cond ((null (setq tmp (getpoint_or_text 2 (strcat "\nPick or Enter text string: <" txtstr "> ")))) (princ "\nERROR - pick text or enter text or Press ENTER.") ) ((= tmp "") ; ENTER was pressed (if (= "" txtstr) (princ "\nERROR - No default text, Try Again.") nil ; exit loop ) ) ((and tmp (= (type tmp) 'str)) ; user entered a string tmp (setq txtstr tmp) nil ; exit loop ) ((and tmp (listp tmp) ; a point was picked (setq en (car (nentselp tmp))) ; get the object ) (if (vlax-property-available-p (vlax-ename->vla-object en) 'TextString) (null (setq txtstr (vla-get-textstring (vlax-ename->vla-object en)))) (princ "\nERROR - Not a text object, Try Again.") ) ) ((princ "\nERROR - pick text or enter text or Press ENTER.")) ) ) ;| Old input string (if (/= (setq tmp (getstring t (strcat "\nEnter text string: < " txtstr " > "))) "") (setq txtstr tmp) ) |; ;; Get object to align text & insert point ;; Object must have curve data (if (setq lst (get_pt_and_angle "\nSelect point on object to label.")) (progn (setq pt (car lst) ang (FixTextAngle (cadr lst)) ) ;; Text height by style or current Text Size (if (zerop (setq txtht (getvar 'textsize))) (setq txtht (getvar "TextSize")) ) (addtext pt txtht txtstr ang acalignmentbottomcenter (getvar "clayer")) ) (prompt "\n** Missed or no curve data for object.") ) (princ) ) (prompt "\nTextAlignWithObject.lsp loaded enter TAO to run.") (princ) ;;;=======================[ getpoint_or_text.lsp ]======================= ;;; Author: Copyright© 2005 Charles Alan Butler ;;; Version: 1.0 Dec. 12, 2005 ;;; Purpose: To get user entered text or picked point ;;; Sub_Routines: -None ;;; Requirements: -ctype is the cursor type ;;; 0 Display the normal crosshairs. ;;; 1 Do not display a cursor (no crosshairs). ;;; 2 Display the object-selection "target" cursor ;;; -prmpt is the user prompt, start it with \n ;;; Returns: - picked point or ;;; the user entered text or ;;; "" for Enter Key ;;; nil for Escape Key ;;;============================================================== (defun getpoint_or_text (ctype prmpt / char code data result flag p str) (vl-load-com) (vl-catch-all-apply '(lambda () (setq flag t str "" ) (princ prmpt) (while flag (setq p (grread t 15 ctype) code (car p) data (cadr p) ) (cond ((= code 3) ; clicked point (setq result data flag nil ) ) ((= code 2) ; keyboard (setq char data) (cond ((<= 32 char 126) (princ (chr char)) (setq str (strcat str (chr char))) ) ((= char ;; backspace was hit .. go chop off a character (and (> (strlen str) 0) (princ (strcat (chr " " (chr )) (setq str (substr str 1 (1- (strlen str)))) ) ) ((= char 13) (setq result str flag nil ) ) ) ) ) ) ;_ while ) ) result ) Quote
asos2000 Posted August 25, 2008 Posted August 25, 2008 Mr. CAB - The lisp makes a copy for the text when picking the text. see attached - How can I change the text gap and angle When pick a text? - When finish Aligning, Could be an option to rotate a text Example Rotate Text 180 Degree [Yes/No] : it helps when rotate the UCS in viewport. See Attached - Could the lisp crossing the text and aligning an object to another abject? Thanx and regards Quote
CAB Posted August 25, 2008 Posted August 25, 2008 All things are possible. Just put the parts you like form each lisp into one. Quote
asos2000 Posted August 25, 2008 Posted August 25, 2008 i dont understand, sorry my mother tongue is not english Quote
ASMI Posted August 25, 2008 Posted August 25, 2008 New version of TALON.LSP with posibility of text copy also with Parallel and Perpendicular text arrangement: http://www.asmitools.com/Files/Lisps/Talon.html Quote
ASMI Posted August 26, 2008 Posted August 26, 2008 Mr ASMI please read reply # 26 I just add new option "Rotate text to 0°- 90° [Yes/No]:". Look to picture. Code on my website. I (think that CAB too) write the programs at this forum while it interestingly for us. If it is not interesting to us we do not write. - Could the lisp crossing the text and aligning an object to another abject? Yes. Quote
lpseifert Posted August 26, 2008 Posted August 26, 2008 Very nice ASMI, I applaud your efforts. Only one problem... after going through all the prompts, the grvecs are displayed, and I accept the position, the text does not display. Anyone else have this problem? Quote
ASMI Posted August 26, 2008 Posted August 26, 2008 Only one problem... after going through all the prompts, the grvecs are displayed, and I accept the position, the text does not display. Anyone else have this problem? Strange. Can you send to me part of your file to e-mail alex@asmitools.com. Maybe it some Civil 3D features? Quote
ASMI Posted August 26, 2008 Posted August 26, 2008 > lpseifert Thank you for example. I just fix this defect and now it works in Paper Space active viewport. Quote
borgunit Posted August 26, 2008 Posted August 26, 2008 BTW, this is an extremely nice piece of work. Quote
Lee Mac Posted September 21, 2008 Posted September 21, 2008 Hi guys, Just been reading this thread and tried the LISP supplied by ASMI, and can I just say, what a fantastic LISP - so professional! :star::star: Quote
cicer Posted January 17, 2010 Posted January 17, 2010 Hello everyone, Can someone please post a copy TALON.lsp cause asmitools is still out of service Thanks Quote
Lee Mac Posted January 17, 2010 Posted January 17, 2010 Here are a couple of alternatives: http://www.cadtutor.net/forum/showthread.php?t=37646 http://www.cadtutor.net/forum/showthread.php?t=42426 Quote
asos2000 Posted January 17, 2010 Posted January 17, 2010 Please find attached and this link for all his library http://www.cadtutor.net/forum/showthread.php?t=43876 AsmiTools_Talon.zip 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.