Tiger Posted November 27, 2008 Share Posted November 27, 2008 Hi guys, I'm wondering if someone has a lisp in store that looks like the image I've attached. it's basically a line with an attached circle and a number inserted in the centre of the circle. So I want to be able to pick the end of the line and then where I want the number to be and what number add. Anyone got something like that that I can fiddle with? Thanks in advance Quote Link to comment Share on other sites More sharing options...
NBC Posted November 27, 2008 Share Posted November 27, 2008 Sounds like a job that Multi-Leaders could achieve relatively easily. Quote Link to comment Share on other sites More sharing options...
Tiger Posted November 27, 2008 Author Share Posted November 27, 2008 Yeah I thought so too - but I can't get a circle in there, just a square, and I have to have the circle connected to the line. Quote Link to comment Share on other sites More sharing options...
NBC Posted November 27, 2008 Share Posted November 27, 2008 Tiger, try the attached for size. It's basically a dynamic block. pos_number.dwg Quote Link to comment Share on other sites More sharing options...
Tiger Posted November 27, 2008 Author Share Posted November 27, 2008 thanks NBC I would like to have a bit more flexability on it though; extend the line easily and twist it around a bit though... Quote Link to comment Share on other sites More sharing options...
NBC Posted November 27, 2008 Share Posted November 27, 2008 All you need to do is to position your arrow as to where you wish to; then drag the number and circle to wherever you want it to go. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 27, 2008 Share Posted November 27, 2008 Hi Tiger, I have a LISP for working with Tank Instrument Tagging, which can insert any number of tags, accounting for the scale of the drawing, and all variables can be customised to suit your needs: ; .: Nozzle & Equipment Tags :. ; ; .: by Lee McDonnell :. (defun c:tktag2 (/ oldlay oldorth oldsnap dwgscal tagpt tagline linent linend tagang cnt tcirc tagcnt tagtxt tcirccent) (princ "\nInitialising...") (if (not (getenv "tag:tsize")) (setenv "tag:tsize" (rtos (getvar "TEXTSIZE"))) ) ; end if (if (not (getenv "tag:tcircr")) (setenv "tag:tcircr" "4.2") ) ; end if (princ (strcat "\nType \"TKTAG2SET\" to Change Base Variables -- Current Settings:" "\n\tText Height: " (getenv "tag:tsize") ",\tText Circle Radius @ 1:1: " (getenv "tag:tcircr") ) ; end strcat ) ; end princ (defun *error*(msg) (setq varLst (list "CMDECHO" "OSMODE" "CLAYER" "DIMSCALE") oldVars (mapcar 'getvar varLst) ); end setq (if oldVars (mapcar 'setvar varLst oldVars) ); end if (princ "\nError Or Esc Pressed... ") (princ) ); end of *error* (setq oldlay (getvar "clayer")) (setq oldorth (getvar "orthomode")) (setq oldsnap (getvar "osmode")) (setvar "cmdecho" 0) (mapcar 'CreateLayer '("1" "2" "3" "4" "5")) (if (/= (setq dwgscal (getreal "\nType Drawing Scale: 1:")) nil) (progn (while (/= (setq tagpt (getpoint "\nSelect First Tag Point: ")) nil) (setvar "clayer" "5") (setvar "orthomode" 1) (prompt "\nSelect Second Tag Point: ") (command "_line" tagpt pause "" ) ; end line (setq tagline (entlast)) (setq linent (entget tagline)) (setq linend (cdr (assoc 11 linent))) (setq tagang (angle tagpt linend)) (setq cnt 1) (setq tcirc (* dwgscal (atof (getenv "tag:tcircr")))) (if (and (setq tagcnt (getint "\nSpecify Number of Tags: ")) (/= tagcnt nil) ) ; end and (progn (while (and (<= cnt tagcnt) (/= (setq tagtxt (getstring (strcat "\nType Text for Tag [" (rtos cnt 2 0) "]: "))) "") ) ; end and (setq tagtxt (strcase tagtxt)) (setvar "clayer" "TEXT") (setq tcirccent (polar linend tagang (* (- (* cnt 2) 1) tcirc) ) ; end polar ) ; end setq (setvar "osmode" 0) (command "_circle" tcirccent tcirc ) ; end circle (entmake (list '(0 . "TEXT") '(8 . "TEXT") (cons 10 tcirccent) (cons 40 (* dwgscal (atof (getenv "tag:tsize")))) (cons 1 tagtxt) '(50 . 0.0) '(7 . "STANDARD") '(71 . 0) '(72 . 1) '(73 . 2) (cons 11 tcirccent) ) ; end list ) ; end entmake (setvar "osmode" oldsnap) (setq cnt (+ cnt 1)) (setq tagtxt "") ) ; end while ) ; end progn (alert "\tTag Number Must Be Greater Than \n\tOr Equal To One.") ) ; end if ) ; end while ) ; end progn (alert "\tDrawing Scale Must Be Greater Than \n\tOr Equal To One.") ) ; end if (setvar "clayer" oldlay) (setvar "orthomode" oldorth) (setvar "cmdecho" 1) (princ "\n\tFunction Complete.") (princ) ) ; end program (defun CreateLayer (Name) (if (not (tblsearch "LAYER" Name)) (command "_.-layer" "_m" Name "_c" Name Name "") ); end if ); end of CreateLayer ; Base Variables (defun c:tktag2set (/ tsize tcircr) (if (not (getenv "tag:tsize")) (setenv "tag:tsize" (rtos (getvar "TEXTSIZE"))) ) ; end if (if (not (getenv "tag:tcircr")) (setenv "tag:tcircr" "4.2") ) ; end if (princ (strcat "\nCurrent Settings:" "\n\tText Height: " (getenv "tag:tsize") ",\tText Circle Radius @ 1:1: " (getenv "tag:tcircr") ) ; end strcat ) ; end princ (if (setq tsize (getreal (strcat "\nSpecify Text Height <" (getenv "tag:tsize") ">: "))) (setenv "tag:tsize" (rtos tsize)) ) ; end if (if (setq tcircr (getreal (strcat "\nSpecify Text Circle Radius @ 1:1 <" (getenv "tag:tcircr") ">: "))) (setenv "tag:tcircr" (rtos tcircr)) ) ; end if (princ "\nBase Variables Set.") (princ) ) ; end program Hope this helps - let me know if you have any queries. Quote Link to comment Share on other sites More sharing options...
Tiger Posted November 27, 2008 Author Share Posted November 27, 2008 When I insert it, I just get one grip point at the end of the arrow, can only move the whole thing? Quote Link to comment Share on other sites More sharing options...
NBC Posted November 27, 2008 Share Posted November 27, 2008 When I insert it, I just get one grip point at the end of the arrow, can only move the whole thing? Yes, I had trouble with the dynamic block. Once you have inserted the dwg file into your drawing, you will need to explode it just the once; to have the functionality I described in my previous post. Quote Link to comment Share on other sites More sharing options...
Tiger Posted November 27, 2008 Author Share Posted November 27, 2008 hey, Lee, thanks However, after I get this: Type "TKTAG2SET" to Change Base Variables -- Current Settings: Text Height: 5, Text Circle Radius @ 1:1: 7 Type Drawing Scale: 1:1 Select First Tag Point: Error Or Esc Pressed... Command: NBC - can't explode it... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 27, 2008 Share Posted November 27, 2008 Hi Tiger, Yeh, sorry about that - I didnt include a layer creator in the code as I always use a template: Try this: ; .: Nozzle & Equipment Tags :. ; ; .: by Lee McDonnell :. (defun c:tktag2 (/ *error* oldlay oldorth oldsnap dwgscal tagpt tagline linent linest linend tagang cnt tcirc tagcnt tagtxt tcirccent) (princ "\nInitialising...") (if (not (getenv "tag:tsize")) (setenv "tag:tsize" (rtos (getvar "TEXTSIZE"))) ) ; end if (if (not (getenv "tag:tcircr")) (setenv "tag:tcircr" "4.2") ) ; end if (princ (strcat "\nType \"TKTAG2SET\" to Change Base Variables -- Current Settings:" "\n\tText Height: " (getenv "tag:tsize") ",\tText Circle Radius @ 1:1: " (getenv "tag:tcircr") ) ; end strcat ) ; end princ (defun *error*(msg) (setq varLst (list "CMDECHO" "OSMODE" "CLAYER" "DIMSCALE") oldVars (mapcar 'getvar varLst) ); end setq (if oldVars (mapcar 'setvar varLst oldVars) ); end if (princ "\nError Or Esc Pressed... ") (princ) ); end of *error* (setq oldlay (getvar "clayer")) (setq oldorth (getvar "orthomode")) (setq oldsnap (getvar "osmode")) (setvar "cmdecho" 0) (if (not (tblsearch "LAYER" "TAGLINE")) (command "-layer" "m" "TAGLINE" "c" "5" "TAGLINE" "")) (if (not (tblsearch "LAYER" "TEXT")) (command "-layer" "m" "TEXT" "c" "2" "TEXT" "")) (if (/= (setq dwgscal (getreal "\nType Drawing Scale: 1:")) nil) (progn (setvar "clayer" "TAGLINE") (while (/= (setq tagpt (getpoint "\nSelect First Tag Point: ")) nil) (prompt "\nSpecify Other Tag Points: ") (command "_line" tagpt) (while (> (getvar 'CmdActive) 0) (command pause)) (setq tagline (entlast)) (setq linent (entget tagline)) (setq linest (cdr (assoc 10 linent))) (setq linend (cdr (assoc 11 linent))) (setq tagang (angle linest linend)) (setq cnt 1) (setq tcirc (* dwgscal (atof (getenv "tag:tcircr")))) (if (and (setq tagcnt (getint "\nSpecify Number of Tags: ")) (/= tagcnt nil) ) ; end and (progn (while (and (<= cnt tagcnt) (/= (setq tagtxt (getstring (strcat "\nType Text for Tag [" (rtos cnt 2 0) "]: "))) "") ) ; end and (setq tagtxt (strcase tagtxt)) (setvar "clayer" "TEXT") (setq tcirccent (polar linend tagang (* (- (* cnt 2) 1) tcirc) ) ; end polar ) ; end setq (setvar "osmode" 0) (command "_circle" tcirccent tcirc ) ; end circle (entmake (list '(0 . "TEXT") '(8 . "TEXT") (cons 10 tcirccent) (cons 40 (* dwgscal (atof (getenv "tag:tsize")))) (cons 1 tagtxt) '(50 . 0.0) '(7 . "STANDARD") '(71 . 0) '(72 . 1) '(73 . 2) (cons 11 tcirccent) ) ; end list ) ; end entmake (setvar "osmode" oldsnap) (setq cnt (+ cnt 1)) (setq tagtxt "") ) ; end while ) ; end progn (alert "\tTag Number Must Be Greater Than \n\tOr Equal To One.") ) ; end if ) ; end while ) ; end progn (alert "\tDrawing Scale Must Be Greater Than \n\tOr Equal To One.") ) ; end if (setvar "clayer" oldlay) (setvar "orthomode" oldorth) (setvar "cmdecho" 1) (princ "\n\tFunction Complete.") (princ) ) ; end program ; Base Variables (defun c:tktag2set (/ tsize tcircr) (if (not (getenv "tag:tsize")) (setenv "tag:tsize" (rtos (getvar "TEXTSIZE"))) ) ; end if (if (not (getenv "tag:tcircr")) (setenv "tag:tcircr" "4.2") ) ; end if (princ (strcat "\nCurrent Settings:" "\n\tText Height: " (getenv "tag:tsize") ",\tText Circle Radius @ 1:1: " (getenv "tag:tcircr") ) ; end strcat ) ; end princ (if (setq tsize (getreal (strcat "\nSpecify Text Height <" (getenv "tag:tsize") ">: "))) (setenv "tag:tsize" (rtos tsize)) ) ; end if (if (setq tcircr (getreal (strcat "\nSpecify Text Circle Radius @ 1:1 <" (getenv "tag:tcircr") ">: "))) (setenv "tag:tcircr" (rtos tcircr)) ) ; end if (princ "\nBase Variables Set.") (princ) ) ; end program Quote Link to comment Share on other sites More sharing options...
Tiger Posted November 27, 2008 Author Share Posted November 27, 2008 yeay! thanks Lee, works perfectly! Quote Link to comment Share on other sites More sharing options...
NBC Posted November 27, 2008 Share Posted November 27, 2008 NBC - can't explode it... Bedit, then explode Come on now Tiger; must we do everything for you ? Quote Link to comment Share on other sites More sharing options...
Tiger Posted November 27, 2008 Author Share Posted November 27, 2008 Bedit, then explode Come on now Tiger; must we do everything for you ? Yep, that's what you're here for and no, can't get it to behvae like you described..I can get it down to the block det-leader1 but that I can't exlpode and I only have one grippoint Quote Link to comment Share on other sites More sharing options...
NBC Posted November 27, 2008 Share Posted November 27, 2008 BEDIT the block det-leader. Then in the Properties diallogue box (with no entities selected); look for Allow Exploding, and then set it to Yes. BSAVE, then BCLOSE. you should now be able to explode the block. Quote Link to comment Share on other sites More sharing options...
Tiger Posted November 27, 2008 Author Share Posted November 27, 2008 BEDIT the block det-leader.Then in the Properties diallogue box (with no entities selected); look for Allow Exploding, and then set it to Yes. BSAVE, then BCLOSE. you should now be able to explode the block. so yes, thanks, now I can explode the block. but if I do, I loose the attributed block functions....have I lost you somewhere NBC? Or did you loose me? Quote Link to comment Share on other sites More sharing options...
NBC Posted November 27, 2008 Share Posted November 27, 2008 I don't know ! Let me re-cap things. 1. Insert the uploaded dwg file into your drawing. 2. Explode the block you just inserted. 3. Click the block and drag the whole of the block (using the square located at the arrow end) into the required position. 4. Click the block and drag the Number/Circle (using the square located at the centre of the circle) into the required position. 5. Edit the attributes to show your desired number. Quote Link to comment Share on other sites More sharing options...
Tiger Posted November 27, 2008 Author Share Posted November 27, 2008 Yeay! I downloaded the block again and now it works, somehow earlier I never got the blue grip inside the circle to show. Thanks again NBC Quote Link to comment Share on other sites More sharing options...
lpseifert Posted November 27, 2008 Share Posted November 27, 2008 Are you sure a Multileader won't work with the built-in circle block or user block? Quote Link to comment Share on other sites More sharing options...
NBC Posted November 27, 2008 Share Posted November 27, 2008 I tried that LPS; but the leader line always 'defaults' to one of the circle quadrants, rather than radiating from the centre of the circle (and ending at the circles edge) Quote Link to comment Share on other sites More sharing options...
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.