Jump to content

Insert acad point at text ins pt


stevesfr

Recommended Posts

Can this be done globally through lisp? Say I have many short pieces of text in a drawing (at various Z values). How to insert an Acad point at the insertion point of these short texts. I'd like to put all the Acad points on one unique layer and do it globally... bam !

TIA for clues...

Tried looking at LM point manager, but it does not address this issue.

Steve

Link to comment
Share on other sites

Steve,

 

I'd start with something like this:

 

[b][color=BLACK]([/color][/b]defun c:txt2pt [b][color=FUCHSIA]([/color][/b]/ ss en ed p10 p11 ip[b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [color=#2f4f4f]"X"[/color] '[b][color=GREEN]([/color][/b][b][color=BLUE]([/color][/b]0 . [color=#2f4f4f]"TEXT"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]  [color=#8b4513];;;ADD FILTERS AS NEEDED[/color]
      [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]         [color=#8b4513];;;WHILE THERE IS A PICKSET[/color]
             [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b]            [color=#8b4513];;;GET THE 1ST ENAME[/color]
                  p10 [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 10 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b]    [color=#8b4513];;;BASE POINT[/color]
                  p11 [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 11 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b]    [color=#8b4513];;;JUSTIFY POINT[/color]
                   ip [b][color=GREEN]([/color][/b]if [b][color=BLUE]([/color][/b]or [b][color=RED]([/color][/b]> [b][color=PURPLE]([/color][/b]cdr [b][color=TEAL]([/color][/b]assoc 72 ed[b][color=TEAL])[/color][/b][b][color=PURPLE])[/color][/b] 0[b][color=RED])[/color][/b]
                              [b][color=RED]([/color][/b]> [b][color=PURPLE]([/color][/b]cdr [b][color=TEAL]([/color][/b]assoc 73 ed[b][color=TEAL])[/color][/b][b][color=PURPLE])[/color][/b] 0[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b]
                          p11 p10[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]          [color=#8b4513];;;DETERMINE THE INSERT POINT[/color]
             [b][color=MAROON]([/color][/b]entmake [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]cons 0 [color=#2f4f4f]"POINT"[/color][b][color=BLUE])[/color][/b] [color=#8b4513];;;ENTMAKE THE POINT[/color]
                            [b][color=BLUE]([/color][/b]assoc 8 ed[b][color=BLUE])[/color][/b]
                            [b][color=BLUE]([/color][/b]cons 10 [b][color=RED]([/color][/b]trans ip en 0[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b]
                            [b][color=BLUE]([/color][/b]assoc 210 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
           [color=#8b4513]; [b][color=MAROON]([/color][/b]entdel en[b][color=MAROON])[/color][/b]                     ;;;UNCOMMENT TO ERASE TEXT[/color]
             [b][color=MAROON]([/color][/b]ssdel en ss[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]                 [color=#8b4513];;;STEPS THRU THE PICKSET[/color]
  [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b]

 

You will need to tweak this to your needs ie

change (assoc 8 ed) to (cons 8 "YourLayerName")

 

Also this deals with simple text only.

 

HTH -David

Link to comment
Share on other sites

How about this thread?

 

(just ignore the beer-talk)

 

Tiger - just what is needed........ many thanks and many beers !!! (hic)

thanks also to Lee for its origin.

Steve

Link to comment
Share on other sites

How about this thread?

 

(just ignore the beer-talk)

 

Tiger - just what is needed........ many thanks and many beers !!! (hic)

thanks also to Lee for its origin.

Steve

 

Huh!? What!?? :huh: I've missed beer talk!??? ...

 

Meh - "she who shall not be named" had to break up the brouhaha with the word sober. :(

 

Not-exactly-what-I-want-to-read-before-Independence-Day-weekend. LoL

 

...Thank's a lot Debbie Downer.

 

208736d1292371677-petition-maxell-reintroduce-reel-reel-tape-famousdc-debbie-downer-supreme-court.jpg

 

(^^ Sorry, I couldn't miss an opportunity to make a shameless plug for SNL - Ehhhehehehehehe ^^)

 

:lol:

Edited by BlackBox
I always catch the typos AFTER I hit the button!
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...