See the top rated post in this thread. Click here

Results 1 to 9 of 9

Thread: Editing home Addresses

  1. #1
    Active Member
    Join Date
    2010-06
    Location
    Vancouver, WA
    Posts
    66
    Login to Give a bone
    0

    Default Editing home Addresses

    I did a search and could not find what I was looking for, so here I am.

    I need lisp to edit home addresses. An exapmle would be 2001 N HENRY ST to only show the number 2001.

    Addresses can have different lengths of digits.

    If this question/need has already been answered, I appologize.

    Thank you in advance for tour time

  2. #2
    Active Member
    Join Date
    2015-12
    Location
    Western Europe
    Posts
    57
    Login to Give a bone
    0

    Default Re: Editing home Addresses

    One swallow does not a Summer make. I can immediately think of a solution for the single example given, but this doesn't mean it would work for any other address.

  3. #3
    Active Member
    Join Date
    2010-06
    Location
    Vancouver, WA
    Posts
    66
    Login to Give a bone
    0

    Default Re: Editing home Addresses

    Currently I have to click each one, delete the text. click repeat.....
    Any way to make this quicker would be greatly appreciated.
    Thanks

  4. #4
    Member
    Join Date
    2001-03
    Location
    ROMANIA
    Posts
    35
    Login to Give a bone
    0

    Default Re: Editing home Addresses

    (atoi "2001 N HENRY ST") ;; -> 2001
    (itoa (atoi "2001 N HENRY ST")) ;; -> "2001"

  5. #5
    Active Member
    Join Date
    2015-12
    Location
    Western Europe
    Posts
    57
    Login to Give a bone
    0

    Default Re: Editing home Addresses

    Quote Originally Posted by jpglisson View Post
    Currently I have to click each one, delete the text. click repeat.....
    Any way to make this quicker would be greatly appreciated.
    Thanks
    I understand that :

    Is the number always the first item in the string?

    Are there any other numbers in the string eg a numeric zip code?

    Are the text strings a "TEXT" entity, a "MTEXT" entity etc.

    Are they all on the same unique layer?

  6. #6
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Editing home Addresses

    Is there a reason you can't / won't use "find and replace"?

    Find: "2001 N HENRY ST"

    Replace with: "2001"

  7. #7
    Active Member
    Join Date
    2010-06
    Location
    Vancouver, WA
    Posts
    66
    Login to Give a bone
    0

    Default Re: Editing home Addresses

    Because I might have close to a hundred different addresses

    - - - Updated - - -

    The number is always first.

    The street name might be a number like 2001 E 5th Drive

    Each address is a seperate mtext

    All are on the same layer

    Thanks

  8. #8
    Active Member
    Join Date
    2015-12
    Location
    Western Europe
    Posts
    57
    Login to Give a bone
    1

    Default Re: Editing home Addresses

    Quote Originally Posted by jpglisson View Post
    Because I might have close to a hundred different addresses

    - - - Updated - - -

    The number is always first.

    The street name might be a number like 2001 E 5th Drive

    Each address is a seperate mtext

    All are on the same layer

    Thanks
    If the number is always first then this should work. It will loop asking "Select Text to Process : ". When you want to end the loop select a blank area of the screen. This will work for text and mtext.

    Code:
    ;;
    (defun splitstr ( s d / p ) (if (setq p (vl-string-search d s))(cons (substr s 1 p) (splitstr (substr s (+ p 1 (strlen d))) d)) (list s)))
    
    (vl-load-com)
    
    (defun c:nos ( / sel ent obj str)
    
      (while (setq sel (entsel "\nSelect Text to Process : "))
        (setq obj (vlax-ename->vla-object (setq ent (car sel))))
              
        (cond ( (or (= "TEXT" (cdr (assoc 0 (entget ent))))
                    (= "MTEXT" (cdr (assoc 0 (entget ent))))
                );end_or
                (setq str (car (splitstr (vlax-get-property obj 'textstring) " ")))
                (vlax-put obj 'textstring str)
              )
        )
      )
    )
    ;;
    Once loaded type nos to run
    Last edited by dlanor; 2020-07-16 at 01:55 PM. Reason: remove global variables

  9. #9
    Active Member
    Join Date
    2010-06
    Location
    Vancouver, WA
    Posts
    66
    Login to Give a bone
    0

    Default Re: Editing home Addresses

    Thanks dlanor. Sorry I didn't get back sooner, I was put on another job this morning. Just checked it out.

    Thanks, works great. This will save me a lot of time. SHHH don't tell my boss.

Similar Threads

  1. 2016: Revit Lighting Control - modular wiring/ Dali addresses
    By daniel.cosgrove625307 in forum Revit MEP - General
    Replies: 0
    Last Post: 2017-01-04, 10:48 AM
  2. Revit blog/web addresses
    By ACE001 in forum Revit Architecture - General
    Replies: 0
    Last Post: 2008-07-31, 12:11 PM
  3. IMPORTANT!!!! Remember to match Email Addresses
    By christopher.zoog51272 in forum Announcements
    Replies: 0
    Last Post: 2004-05-17, 05:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •