Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Change stationing text incrementa lly
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Is ther a way to change sttioning text incrementally? For example, I have text (0+00) spaced every 100 ft. along the bottom of a profile grid. I want to be able to pick the first, have it change to 1+00, then the second, have it changed to 2+00, etc. I have looked for a lisp routine online, but have not found one. I am not very good at creating them myself, so can anyone help?
Solved! Go to Solution.
Re: Change stationing text incrementa lly
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Why not move them 100' ?
Re: Change stationing text incrementa lly
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I am not sure I understand what you mean. I want to to pick text (0+00) already placed so that when I am finished, they read as follows:
0+00 1+00 2+00 3+00 ..... and so on, along the bottom of my profile grid. I have some routines that will increment changes, but they only produce the same result for each text (1+00 1+00 1+00), when I want the second and third and so on picks to change by 100 more then the last.
Re: Change stationing text incrementa lly
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
paste then type Next_Station in command line
(defun C:Next_Station (/ num cent)
(vl-load-com)
(setq num (atoi (substr (vla-get-textstring (vlax-ename->vla-object (car (entsel "\nSelect Beginning Station: ")))) 1 1)))
(prompt "\nSelect Next Station: ")
(while (setq cent (vlax-ename->vla-object (car (entsel))))
(setq num (1+ num))
(vla-put-textstring cent (strcat (itoa num) (substr (vla-get-textstring cent) 2)))
);while
(princ)
);defun
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Re: Change stationing text incrementa lly
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
It was a joke (If you moved the text 100' that's where it is)
Civil is my bread and butter ![]()
Re: Change stationing text incrementa lly
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
(defun C:Next (/ Start TxtObject strt Next)
(vl-load-com)
(cond ((and
(setq Start (car (entsel "\nSelect Beginning Station: ")))
(eq (vla-get-ObjectName (setq TxtObject (vlax-ename->vla-object Start))) "AcDbText")
(setq num (vla-get-textstring TxtObject))
(setq strt (itoa (+ (atoi (vl-string-subst "" "+" num)) 100)))
(not (prompt "\nSelect Next Station: "))
(while (setq Next (car (entsel)))
(and
(eq (vla-get-ObjectName (setq TxtObject (vlax-ename->vla-object Next))) "AcDbText")
(not (vla-put-textstring TxtObject
(strcat
(substr strt 1 (- (strlen strt) 2))
"+"
(substr strt (1+ (- (strlen strt) 2))))))
(setq strt (itoa (+ (atoi strt) 100)))
)
)
)
)
)(princ)
)
Re: Change stationing text incrementa lly
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: Change stationing text incrementa lly
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thank you, Sheneuph and Pbejse, the routines you both posted work great!
Re: Change stationing text incrementa lly
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Wow! Thanks, Patchy! That program is really something. I would not even begin to know how to do something like that.
