Jump to content

Automatic Text Numbering V4, specific distance ( X or Y direction ) from cursor poin


Recommended Posts

Posted

Firstly thank you very much for this site.

 

Today i downloaded and used "automatic text numbering V4" lisp. Very useful and successful.

 

I need more property in this lisp. When i use this lisp i want that numbered text will be consist specific distance ( X or Y direction ) from cursor point.

 

Thanks in advance.

  • Replies 25
  • Created
  • Last Reply

Top Posters In This Topic

  • ferhatpeker

    12

  • pBe

    9

  • fixo

    2

  • Lee Mac

    1

Posted (edited)

Not as well rounded and efficient as ATN_V4 but works nonetheless

 

(Defun c:CMI  (/ parseStr _inccopy TxtObj fp sp dst ang)
     (vl-load-com)
     [color=blue](defun parseStr  (str / strA pr v)[/color]
[color=blue]            (setq strA (if (zerop (atoi (setq v str)))[/color]
[color=blue]                          (setq pr (vl-string-right-trim "0123456789" str))[/color]
[color=blue]                              (progn (setq pr "") v)))[/color]
[color=blue] (strcat pr (itoa (1+ (atoi (if (eq  strA str) strA (vl-string-trim strA str)  )))))[/color]
[color=blue]           )[/color]
     [color=blue](defun _inccopy (e p1 p2)[/color]
[color=blue]           (vla-move (setq e (vla-copy e))[/color]
[color=blue]                      (vlax-3d-point p1)[/color]
[color=blue]                      (vlax-3d-point p2))[/color]
[color=blue]           (vla-put-textstring e[/color]
[color=blue]  (parseStr (vla-get-textstring e)))[/color]
[color=blue]           e[/color]
[color=blue]           )         [/color]
     (cond ((and
                  (setq TxtObj (ssget "[b][color=blue]_[/color][/b]:L:S:E" '((0 . "TEXT"))))
                  (setq TxtObj (vlax-ename->vla-object
                                     (ssname TxtObj 0)))
                  (setq fp (getpoint "\nPick first point: "))
                  (setq sp (getpoint fp "\nPick second point: "))
                  (setq dst (distance
                                  (setq fp (trans fp 1 0))
                                  (setq sp (trans sp 1 0)))
                        ang (angle fp sp))
                 [color=blue] (setq TxtObj (_inccopy TxtObj fp sp))[/color]
                  [color=blue](princ "\nLeft Click to Copy Increment:")[/color]
                  (while [color=blue](= (car (grread nil 10)) 3)[/color]
                        (setq TxtObj[color=blue] (_inccopy TxtObj fp sp))[/color]
                        (setq fp sp
                              sp (polar sp ang dst))
                        )
                  )
             )
           )(princ)
     )

 

HTH

 

EDIT: Modified Code

Edited by pBe
Update Snippet
Posted

thanks pBE.

 

i couldn't understand and use that lisp.

 

I want to see additional function in dialog box of ATM V4 lisp. If you can do that it will be perfect.

 

When i use ATM V4 lisp, i want to specify distance from cursor point for text location. After my click for text location, numbered text will be consist specific distance ( X or Y direction ) from clicked point.

Posted

..... i couldn't understand and use that lisp.....

Thats too bad.

 

.....

I want to see additional function in dialog box of ATM V4 lisp. If you can do that it will be perfect.

I'm sure it would be, but i cant very well do anything about ATN V4.lsp as I'm not the author.

 

i want to specify distance from cursor point for text location. After my click for text location, numbered text will be consist specific distance ( X or Y direction ) from clicked point.

The snippet i posted should be able to do that. (that is if i correctly understand your reqeust)

 

EDIT: thinking about it, i'm probably off with the code i posted

Can you explain this line?

....consist specific distance ( X or Y direction ) from clicked point....

Posted

It means, for example I want to gove numbers just out of a circle but I want to click center of the circle. I will give number to X and Y larger than the diameter of the circle so that when I click center of the circle, number will be placed just out of it as I wanted. That is why I wanted that thing. Thanks.

Posted
It means, for example I want to gove numbers just out of a circle but I want to click center of the circle. I will give number to X and Y larger than the diameter of the circle so that when I click center of the circle, number will be placed just out of it as I wanted. That is why I wanted that thing. Thanks.

 

:? .... I think I'll pass on this one .....

 

BTW: Welcome to the forum :)

Posted
:? .... I think I'll pass on this one .....

 

BTW: Welcome to the forum :)

Check this snippet again please

I want the same but the code above isn't working on my end

Maybe some lines was lost by copy-paste....

Regards,

Oleg

Posted

Can't anybody help me for this lisp?

Posted
Check this snippet again please

I want the same but the code above isn't working on my end

Maybe some lines was lost by copy-paste....

Regards,

Oleg

 

By george you are right!! Thank you for testing Oleg.

 

Code Updated

 

But i still dont think thats what the OP wants.

At any rate... what it does is increment the string value by 1 and continues to add and copy as you Left-Click the mouse at the same angle and distance from first point and second point.

 

Cheers :)

Posted

Awesome

Thanks for your work

Already what I wanted

Regards,

 

Oleg

Posted
Awesome

Thanks for your work

Already what I wanted

Regards,

 

Oleg

 

Thank you Oleg. At least somebody have a use for it :)

 

Cheers :beer:

 

Unfortunately, this is not my need. :cry:

Thanks in any case.

 

Somehow i cant figure out what you need ferhatpeker, now I'm not even sure we are talking a bout the same Text Numbering lisp code.

Sorry i cant be of any more help

Posted

;; (Contact Lee Mac, CADTutor.net, TheSwamp.org)
;;
;;  ~ With Additional Thanks to:
;;     Charles Alan Butler (CAB)
;;
;;  PLATFORMS:
;;  Tested in ACAD 2004, ACAD 2010.
;;
;;  VERSION:
;;  1.0  ~  18.06.2009  ~ First Release
;;  2.0  ~  25.06.2009  ~ Changed Direction Method
;;  3.0  ~  25.06.2009  ~ Pick Angle added
;; ==========================================
;;
;;  4.0  ~  26.06.2009  ~ CAB combined routines, NumInc.lsp
;;                        A button for each function
;;
;; ==========================================
;;
;; ============ NumInc.lsp ===============
;;
;;  FUNCTION: Number Increment
;;  Will sequentially place numerical
;;  text upon mouse click, with optional
;;  prefix and suffix.
;;
;;  >>  Enter          =  Exit
;;  >>  Space          =  Rotate ACW
;;  >>  Shift + Space  =  Rotate CW
;;  >>  Tab            =  Rotate 90
;;  >>  Shift + Tab    =  Mirror Rotation
;;  >>  C              =  Curve Aligned
;;  >>  R              =  Replace Text/Attribute
;;  >>  T              =  Toggle Counter
;;
;;  AUTHOR:
;;  Copyright (c) 2009, Lee McDonnell
;;  (Contact Lee Mac, CADTutor.net)
;;
;;  PLATFORMS:
;;  Requires Express Tools for full Functionality.
;;  Tested in ACAD 2004, 2010.
;;
;;  VERSION:
;;  1.0  ~  12.04.2009  ~ First Release
;;  2.0  ~  14.04.2009  ~ Incremental Prefix/Suffix
;;  3.0  ~  15.04.2009  ~ DCL Version
;;  4.0  ~  15.04.2009  ~ Replace Text Added
;;  5.0  ~  16.04.2009  ~ Leading Zeros Allowed
;;  6.0  ~  18.06.2009  ~ Total Program Upgrade
;;  7.0  ~  27.06.2009  ~ Counter Toggle/Bug Fixes
;;
;; =======================================

 

This lisp which i use. ( only description )

Posted

;;
;; AUTHOR:
;; Copyright (c) 2009, Lee McDonnell
;; ([b][color=blue]Contact Lee Mac[/color][/b], CADTutor.net)
;;
;; PLATFORMS:
;; Requires Express Tools for full Functionality.
;; Tested in ACAD 2004, 2010.
;;

 

This lisp which i use. ( only description )

 

There's your answer ferhatpeker ;)

Posted (edited)

I know :(

 

But he didn't write anything till now. And i don't want to write special message to him. Maybe he is busy. :)

Edited by ferhatpeker
Posted
But he didn't write anything till now. And i don't want to write special message to him. Maybe he is busy. :)

 

I replied to your email stating that I was no longer developing this program.

Posted

I think what the OP needs is HERE..http://www.lee-mac.com/numinc.html JUST LACKING OFFSET XY

Posted

I also used that lisp. But i need additional function.

 

"It means, for example I want to gove numbers just out of a circle but I want to click center of the circle. I will give distance for X and Y direction larger than the diameter of the circle so that when I click center of the circle, number will be placed just out of it as I wanted. "

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...